Font size
WorksheetsAdvanced Data Engineer Assessment
Total questions: 106
Worksheet time: 53mins
What is the purpose of WITH RECURSIVE in SQL?
Caches query results
Creates writable temporary tables
Enables iterative queries for trees or graphs
Partitions large tables
When should EXISTS be preferred over IN in a subquery?
Small subtables
Duplicate-heavy parent tables
Existence checks for performance
Multiple OR conditions
When is a bitmap index most effective?
High-cardinality columns
Low-cardinality columns
Text-heavy columns
Multi-join queries
What does ANALYZE do in PostgreSQL?
Collects query optimization statistics
Deletes duplicates
Accelerates writes
Partitions tables
What is a MATERIALIZED VIEW in PostgreSQL?
Physically stored query results
Auto-updating view
Recursive query support
Temporary table replacement
Which window function accesses the next row’s value?
RANK()
LAG()
LEAD()
NTILE()
What does VACUUM do in PostgreSQL?
Deletes duplicates
Reclaims space and updates statistics
Speeds up writes
Creates indexes
When is PARTITION BY used in window functions?
Groups data without reducing rows
Joins tables
Removes duplicates
Physically partitions tables
In SQL Server, what does INCLUDE in an index achieve?
Accelerates writes
Stores extra columns in the index
Partitions tables
Updates statistics
How can you reduce GROUP BY query cost?
Use HAVING instead of WHERE
Index GROUP BY columns and filter with WHERE
Use DISTINCT
Increase cache
In PySpark, what does persist(StorageLevel.DISK_ONLY) do?
Stores in memory
Stores on disk if memory is low
Stores entirely on disk
Chooses memory or disk
What is the difference between repartition() and coalesce() in PySpark?
Both reduce partitions
repartition() shuffles, coalesce() does not
coalesce() adds partitions
repartition() is for narrow transformations
When is a broadcast join useful in Spark?
Both tables are large
Small table can be broadcast
Outer joins
Pre-partitioned data
What distinguishes RDDs from DataFrames in Spark?
RDDs lack schema, DataFrames have schema
RDDs are always faster
DataFrames lack transformations
RDDs cannot be cached
What does cache() do in PySpark?
Stores data in memory
Stores on disk
Removes duplicates
Adds partitions
What is the purpose of explode() in PySpark?
Splits array column into rows
Compresses data
Removes nulls
Creates indexes
How can you process a large CSV in Pandas?
Use chunksize in pd.read_csv
Increase RAM
Use NumPy
Use groupBy()
What does spark.sql.autoBroadcastJoinThreshold do?
Automates broadcast joins
Increases partitions
Disables broadcast joins
Processes text
What is the Spark UI used for in PySpark?
Monitors execution and performance
Counts rows
Shows schema
Lists nulls
How can you process streaming data in PySpark?
Use spark.readStream and writeStream
Use spark.read and write
Use RDDs
Use groupBy()
In Airflow, what is a task instance?
DAG definition
Specific task execution
Task group by date
Python code line
What does dbt run do?
Deletes data
Executes all models
Checks errors
Builds documentation
How does Luigi differ from Airflow?
No UI
No DAGs
Task dependency focus
Python 2 only
Why is ELT preferred over ETL?
ETL scales better
ELT uses Data Warehouse compute
ELT skips logging
ETL fails with semi-structured data
How do you handle a failed task in Airflow?
Set retries and retry_delay
Add executors
Use Luigi
Delete DAG
What is an incremental model in dbt?
Processes all data
Processes new/changed data
Deletes old data
Creates documentation
What is XCom in Airflow?
Passes data between tasks
Stores data on disk
Speeds tasks
Documents DAGs
What does ref() do in dbt?
References models
Creates indexes
Speeds queries
Removes duplicates
What is a Sensor in Airflow?
Checks conditions
Speeds tasks
Documents DAGs
Removes duplicates
What is a snapshot in dbt?
Tracks data history
Speeds queries
Creates indexes
Deletes duplicates
What is the focus of the Kimball model?
Star schemas for analytics
Data Lakes for raw data
No-transformation integration
Streaming pipelines
How does Inmon differ from Kimball?
3NF vs. star schemas
No query support
Semi-structured data
Data Lake focus
What does a fact table hold in Kimball?
Metrics and dimension keys
Raw data
Change history
Query indexes
What is a hub in Data Vault?
Business keys
Raw data
Star schemas
Query speed
What is a star schema’s benefit in Kimball?
Fast analytics
Semi-structured support
Multi-source integration
History tracking
What is a conformed dimension in Kimball?
Shared across fact tables
Raw data
Single fact table
History storage
What is a satellite in Data Vault?
Attributes and history
Business keys
Star schemas
Query speed
When is Data Vault most suitable?
Multi-source integration with history
Fast star schema queries
Streaming data
Duplicate removal
What is Trino best for?
Multi-source analytics
Streaming
ETL pipelines
Raw storage
When is DuckDB suitable?
Single-machine moderate data
Multi-node Big Data
Streaming
Multi-source integration
What feature does Delta Lake provide?
ACID and schema enforcement
Auto-partitioning
Query speed
Duplicate removal
What file format does DuckDB prefer?
Parquet
JSON
CSV
Avro
What is Apache Iceberg’s key feature?
Schema evolution and time travel
Faster queries
Streaming
Lower storage
What is time travel in Delta Lake?
Historical data queries
Query speed
Streaming
Duplicate removal
What is a catalog in Trino?
Connects data sources
Speeds queries
Creates pipelines
Removes duplicates
What does a Lakehouse combine?
Raw storage and analytics
Raw data only
Query speed only
Streaming only
What is a metastore’s role in a Lakehouse?
Manages metadata
Speeds queries
Stores raw data
Creates streams
How do you secure on-premise data?
Encryption and IAM
More partitions
Disable caching
Raw data
What optimizes Spark jobs in Databricks?
AQE and Delta Cache
More partitions
Pandas
groupBy()
What is Unity Catalog in Databricks?
Metadata and access management
Query speed
Streaming
Duplicate removal
How do you optimize a query with multiple JOINs on a billion-row table?
Index all columns
Use EXPLAIN, partition tables, and add selective indexes
Convert to UNION
Increase cache
How do you handle data skew in a partitioned table query?
Increase partitions
Use DISTRIBUTE BY for redistribution
Drop indexes
Increase cache
In PostgreSQL, how does CLUSTER affect a frequently updated table?
Improves reads but slows writes
Speeds writes
Removes duplicates
Refreshes statistics
How do you optimize a query with multiple OR conditions?
Rewrite as UNION for indexing
Increase cache
Use IN
Drop indexes
In Oracle, how does PARALLEL hint impact complex joins?
Enables parallel execution with I/O risks
Reduces records
Disables indexes
Partitions tables
How does PARALLEL hint impact complex joins?
Enables parallel execution with I/O risks
Reduces records
Disables indexes
Partitions tables
How do you optimize MERGE for millions of daily updates?
Index primary key
Partition and index WHEN MATCHED columns, batch updates
Disable indexes
Use temporary table
When does INDEX SKIP SCAN improve performance?
First index column unused, later columns selective
Dropping index
Small tables
GROUP BY
How do you fix a PostgreSQL query plan ignoring an index?
Use ANALYZE and tune cost
Drop and recreate index
Increase timeout
Use non-indexed table
How do you optimize a partitioned table with poor pruning?
Include partition key filters, check with EXPLAIN
Drop partitions
Increase partitions
Use non-partitioned table
In MySQL, when is FORCE INDEX used, and what are risks?
Suboptimal index choice, risks outdated plans
Dropping index
Small tables
GROUP BY analysis
How do you mitigate data skew in a PySpark job with billions of rows?
Use repartition() and salting
Add executors
Disable caching
Replace join with groupBy
How do you optimize a PySpark job with excessive shuffling?
Use broadcast joins, tune spark.sql.shuffle.partitions
Increase memory
Disable caching
Use RDDs
How do you handle OutOfMemoryError in a terabyte-scale Spark job?
Tune spark.executor.memory, partition size, spill-to-disk
Disable caching
Use Pandas
Use groupBy()
How do you process complex nested JSON in PySpark?
Use spark.read.json(), explode(), schema inference
Convert to RDD
Use groupBy()
Ignore nested fields
How do you implement SCD Type 2 in PySpark with Delta Lake?
Use MERGE for is_current, end_date
Use groupBy()
Use Pandas
Delete old data
How do you detect and fix data skew in PySpark?
Check df.rdd.getNumPartitions(), use repartition() or salting
Use df.count()
Add executors
Use groupBy()
How does ZORDER improve PySpark query performance?
Clusters data to reduce I/O
Removes duplicates
Adds partitions
Disables caching
How do you optimize Dask for a 100GB dataset?
Use dask.dataframe, optimize partitioning
Use Pandas
Increase RAM
Use NumPy
How do you handle streaming with Spark Structured Streaming and Delta Lake?
Use writeStream, merge, checkpointing
Use spark.read
Use RDDs
Use groupBy()
How do you tune a Spark job for low-latency on a 1TB dataset?
Use ZORDER, tune spark.sql.shuffle.partitions, enable AQE
Add nodes
Use Pandas
Disable caching
How do you optimize a 50+ task Airflow DAG?
Limit parallelism, use LocalExecutor, SubDAGs
Add workers
Use dbt
Disable tasks
How do you ensure idempotency in an ELT pipeline?
Use MERGE or upsert with unique keys
Add partitions
Disable caching
Use groupBy()
How do you handle schema evolution in dbt?
Use on_schema_change with incremental models
Use groupBy()
Add partitions
Use Airflow
How do you troubleshoot a failing Airflow pipeline?
Analyze UI, logs, dependencies
Use dbt test
Add executors
Use Luigi
How do you manage complex dependencies in Luigi?
Use requires() with dynamic scheduling
Use SubDAGs
Add workers
Use Airflow
How do you integrate Airflow with Databricks for streaming?
Use DatabricksSubmitRunOperator, Delta Live Tables
Use dbt run
Add partitions
Use Luigi
How do you ensure data quality in a dbt pipeline?
Custom tests with dbt test, schema validation
Use dbt run
Use Airflow
Use groupBy()
How do you rerun a failed Luigi pipeline?
Use --force
Add workers
Use Airflow
Delete pipeline
How do you handle streaming in an ELT pipeline with Airflow?
Integrate with Spark Streaming or Kafka
Use Airflow directly
Use dbt
Use SubDAGs
How do you scale Airflow for 1000+ daily tasks?
Use CeleryExecutor, distributed workers, DB tuning
Increase tasks
Use Luigi
Disable DAGs
How do you implement SCD Type 2 in Data Vault?
Use satellites with load_date, end_date
Use hubs
Use links
Delete data
How does snowflake schema differ from star schema in Kimball?
Normalizes dimensions
Supports semi-structured data
Uses 3NF
Slows queries
What is Data Vault’s advantage over Inmon?
Scalability, history tracking
Faster queries
Streaming
Lower storage
How do you design a Data Vault for frequent schema changes?
Flexible satellites, dynamic hubs
Star schema
Inmon
Delete models
How do you optimize query performance in a Kimball star schema?
Denormalized tables, indexes, materialized views
Normalize dimensions
Use Data Vault
Add partitions
When is Inmon preferred over Kimball?
Enterprise 3NF integration
Fast star schema queries
Streaming
Data Lakes
How do you handle complex relationships in Data Vault?
Use links for many-to-many
Use satellites
Create star schemas
Speed queries
When is Data Vault preferred over Kimball?
Multi-source data with history
Fast star schema queries
Streaming
Lower storage
How does Iceberg differ from Delta Lake?
Open format, less engine dependency
No ACID
No time travel
Streaming only
How do you optimize Trino for petabyte-scale data?
Partition predicates, dynamic partitioning
Add nodes
Use Spark
Use groupBy()
How do you optimize DuckDB for a 500GB dataset?
Use Parquet, query optimization
Use Snowflake
Add nodes
Use Spark
How does Iceberg improve query performance?
Data skipping, hidden partitioning
More nodes
Disable caching
Use Spark
How do you integrate DuckDB with Delta Lake?
Query Delta as Parquet with DuckDB
Use DuckDB for ETL
Use Spark
Add nodes
How do you handle schema evolution in Iceberg?
Use versioning, metadata updates
Delete data
Use Delta
Add partitions
How do you optimize ZORDER in Delta Lake for a 10TB table?
Use high-selectivity columns, optimize partitioning
Remove duplicates
Add partitions
Merge data
How do you synchronize data in a hybrid Lakehouse?
Use Kafka or Delta Streaming
Add on-premise nodes
Move to cloud
Use groupBy()
How do you optimize storage in a hybrid Lakehouse?
Use Parquet, tiered storage
Add nodes
Use Pandas
Use groupBy()
What is a challenge in a hybrid Lakehouse?
Metadata sync and performance
No SQL support
No open-source tools
No Airflow integration
How do you ensure portability in a hybrid Lakehouse?
Use Iceberg or Delta Lake
Add executors
Use dbt
Use Pandas
How do you monitor a hybrid Lakehouse pipeline?
Use Airflow UI, Databricks monitoring
Use dbt test
Add nodes
Use Luigi
How do you handle data skew in Databricks?
Use AQE, repartition()
Add nodes
Use RDBMS
Use groupBy()
How does AQE improve Spark performance?
Adjusts plans with runtime stats
Adds partitions
Disables caching
Uses Pandas
How do you integrate Databricks with Airflow?
Use DatabricksSubmitRunOperator
Use dbt run
Add partitions
Use Luigi
How do you optimize Delta Lake queries in Databricks?
Use ZORDER, partitioning
Use RDBMS
Add nodes
Use groupBy()
How do you build an ML pipeline in Databricks?
Use MLflow, Spark MLlib
Use Pandas
Add executors
Use dbt run
