HireHireInterview Quizzes › Data Engineer

Data Engineer Interview Questions

Think you're ready? These are the questions that actually decide Data Engineer interviews. Warm up on Easy — then face the Hard round, where 95% of candidates crumble. 30 questions across 3 levels, instant score, completely free.

30Questions
3Difficulty levels
95%Fail the hard round
FreeInstant score
Easy
Warm-up · 10 Qs
Medium
Practical · 10 Qs
Hard
Brutal · 10 Qs
⚡ Take the Data Engineer quiz — get your score →

The Data Engineer interview questions

Below are the real questions, grouped by difficulty. Expand any one to reveal the correct answer and why — or take the timed quiz for a score you can share. Can you clear the Hard round?

Easy round 10 questions

In a star schema data warehouse, what does a fact table typically contain?
  • A. Descriptive attributes like product names and customer addresses
  • B. Numeric measures (e.g., sales amount) and foreign keys to dimension tables ✓
  • C. Only primary keys with no measurable data
  • D. Denormalized hierarchies of categories and subcategories
Correct answer: B. A fact table stores quantitative measures along with foreign keys linking to dimension tables, while descriptive attributes live in the dimensions.
In Apache Spark, what triggers actual execution of the computation defined by transformations?
  • A. Every transformation like map() or filter() executes immediately
  • B. An action such as collect() or count() triggers execution ✓
  • C. Creating the SparkSession runs all pending operations
  • D. Caching a DataFrame forces immediate computation of all steps
Correct answer: B. Spark transformations are lazy and only build a DAG; an action like collect() or count() triggers actual execution.
In a Kafka topic, what determines the ordering guarantee of messages?
  • A. Messages are globally ordered across the entire topic
  • B. Ordering is guaranteed only within a single partition ✓
  • C. Kafka does not provide any ordering guarantees
  • D. Ordering is guaranteed across partitions only if replication is enabled
Correct answer: B. Kafka guarantees message order only within an individual partition, not across the whole topic.
Which SQL window function assigns a unique sequential number to rows within a partition, with no gaps and no ties?
  • A. RANK()
  • B. DENSE_RANK()
  • C. ROW_NUMBER() ✓
  • D. NTILE()
Correct answer: C. ROW_NUMBER() assigns a unique consecutive integer to each row with no ties or gaps, unlike RANK() and DENSE_RANK() which can repeat values.
A Slowly Changing Dimension Type 2 is used to:
  • A. Overwrite the old attribute value with the new one, keeping no history
  • B. Preserve full history by adding a new row for each change with validity dates ✓
  • C. Ignore all changes to dimension attributes
  • D. Store changes only in a separate audit log table without new rows
Correct answer: B. SCD Type 2 preserves historical data by inserting a new row for each change, typically with effective/end dates or a current flag.
In the Parquet file format, data is stored using which layout?
  • A. Row-oriented storage
  • B. Columnar storage ✓
  • C. Key-value storage
  • D. Plain delimited text
Correct answer: B. Parquet is a columnar storage format, which enables efficient compression and column pruning for analytical queries.
In Apache Airflow, what does a DAG represent?
  • A. A single task that runs on a schedule
  • B. A directed acyclic graph defining tasks and their dependencies ✓
  • C. A database connection pool
  • D. A message queue for streaming events
Correct answer: B. An Airflow DAG (Directed Acyclic Graph) defines a collection of tasks with their dependencies and execution order.
When partitioning a large table in a data lake by date, the main benefit for query performance is:
  • A. It automatically deduplicates records
  • B. It enables partition pruning so queries scan only relevant date folders ✓
  • C. It compresses all data by 90%
  • D. It guarantees ACID transactions
Correct answer: B. Partitioning by date lets the query engine prune irrelevant partitions, scanning only the folders matching the query's date filter.
What problem does the 'small files problem' in HDFS/data lakes primarily cause?
  • A. Data corruption on write
  • B. Excessive metadata overhead and slow processing due to many tiny files ✓
  • C. Loss of schema information
  • D. Automatic data encryption failures
Correct answer: B. Many small files create heavy metadata/NameNode overhead and inefficient task scheduling, degrading processing performance.
In dimensional modeling, what is the grain of a fact table?
  • A. The total number of rows the table can hold
  • B. The level of detail represented by a single row in the fact table ✓
  • C. The number of dimensions connected to it
  • D. The compression ratio applied to the table
Correct answer: B. The grain defines what a single fact row represents (e.g., one sale line item), setting the level of detail for the whole table.

Medium round 10 questions

You need to keep only the most recent row per (user_id, event_date) group, ordered by event_timestamp. Which SQL approach is the standard way to do this?
  • A. SELECT DISTINCT user_id, event_date FROM events
  • B. Use ROW_NUMBER() OVER (PARTITION BY user_id, event_date ORDER BY event_timestamp DESC) and keep rows where it equals 1 ✓
  • C. GROUP BY user_id, event_date HAVING COUNT(*) > 1
  • D. A self-join on user_id filtered by WHERE rownum = 1
Correct answer: B. ROW_NUMBER() partitioned by the group and ordered by timestamp descending lets you keep exactly the latest row per group by filtering to rank 1.
In a typical ELT pipeline loading into a cloud data warehouse like Snowflake or BigQuery, how does it primarily differ from a traditional ETL pipeline?
  • A. ELT never uses SQL, only Python
  • B. ELT loads raw data into the warehouse first and performs transformations inside the warehouse afterward ✓
  • C. ELT cannot handle incremental loads
  • D. ELT always requires less storage than ETL
Correct answer: B. ELT loads raw data into the warehouse and leverages its compute to transform afterward, whereas ETL transforms data before loading it.
You store large analytical datasets in a data lake and typically query a few columns with aggregations. Which file format is generally the best choice?
  • A. CSV
  • B. Parquet ✓
  • C. Line-delimited JSON
  • D. XML
Correct answer: B. Parquet is a columnar format offering good compression and column pruning, ideal for reading a few columns from large analytical datasets.
A nightly batch job re-processes the entire source table and is getting slow as data grows. The source has a reliable updated_at column. What is the most appropriate improvement?
  • A. Switch storage from Parquet to CSV to speed reads
  • B. Implement incremental loading, processing only rows where updated_at is newer than the last successful run ✓
  • C. Add more SELECT * queries to warm the cache
  • D. Drop and recreate the target table each night
Correct answer: B. Incremental loading using a high-water mark on updated_at processes only changed rows, avoiding costly full reloads as data grows.
In Apache Airflow, what does setting a task's `retries` and `retry_delay` accomplish?
  • A. It runs the task multiple times in parallel to speed it up
  • B. It automatically re-runs a failed task the specified number of times, waiting retry_delay between attempts ✓
  • C. It schedules the DAG to run more frequently
  • D. It caches the task output so it never re-runs
Correct answer: B. retries and retry_delay make Airflow automatically re-attempt a failed task up to the retry count, pausing retry_delay between attempts.
You are designing a star schema for sales analytics. Which of the following best describes a fact table?
  • A. It stores descriptive attributes like customer name and product category
  • B. It stores measurable business events (e.g., sales amount, quantity) plus foreign keys to dimensions ✓
  • C. It stores only slowly changing metadata about the schema
  • D. It is always denormalized to a single flat table with no keys
Correct answer: B. A fact table holds numeric measures of business events along with foreign keys referencing the surrounding dimension tables.
A dimension table must track history so that when a customer's city changes, past facts still reflect the old city. Which technique handles this?
  • A. SCD Type 1 (overwrite the old value)
  • B. SCD Type 2 (add a new row with effective/expiry dates) ✓
  • C. Truncate and reload the dimension nightly
  • D. Store the city only in the fact table
Correct answer: B. Slowly Changing Dimension Type 2 inserts a new versioned row with validity dates, preserving historical values for past facts.
Your Spark job reads a large dataset and one stage is very slow with a few tasks taking far longer than the rest. What is the most likely cause?
  • A. The cluster has too much memory
  • B. Data skew, where some partition keys have far more records than others ✓
  • C. Using Parquet instead of ORC
  • D. The DataFrame API instead of RDDs
Correct answer: B. Uneven distribution of keys (data skew) makes a few partitions much larger, so their tasks lag behind the rest of the stage.
In a partitioned table on a data lake (e.g., partitioned by event_date), what is the main benefit when a query filters on the partition column?
  • A. It automatically deduplicates all rows
  • B. Partition pruning lets the engine skip reading files for irrelevant dates, scanning far less data ✓
  • C. It converts the table to columnar storage automatically
  • D. It guarantees exactly-once processing
Correct answer: B. Filtering on the partition column enables partition pruning, so the engine reads only the relevant partitions and scans much less data.
You want to load data from a REST API that paginates results and enforces a rate limit. Which approach is most robust in your ingestion script?
  • A. Fire all page requests concurrently as fast as possible
  • B. Loop through pages sequentially, handle the next-page token, and back off/retry on 429 responses ✓
  • C. Request only the first page and assume it is complete
  • D. Disable error handling so the job fails fast on any hiccup
Correct answer: B. Iterating pages with the pagination token and backing off on HTTP 429 respects rate limits while retrieving the complete dataset reliably.

Hard round 10 questions

A Spark job joining a 2 TB fact table to a small dimension runs for hours, and the Spark UI shows one task in the final stage processing 400x more shuffle data than the median task while 199 tasks finished quickly. AQE is enabled. The join key `customer_id` has a null/`'UNKNOWN'` value for ~30% of fact rows. Which fix directly addresses the root cause?
  • A. Increase `spark.sql.shuffle.partitions` from 200 to 2000 so the hot key spreads across more partitions
  • B. Split the join: filter out the null/`'UNKNOWN'` keys, broadcast-join the remainder, and union the skewed rows handled separately (or salt the hot key) ✓
  • C. Enable `spark.sql.adaptive.coalescePartitions.enabled` so AQE merges the small partitions
  • D. Cache the dimension table with `.persist(MEMORY_AND_DISK)` before the join
Correct answer: B. All rows sharing the single hot key hash to one partition regardless of partition count, so only isolating/salting that key (or broadcasting) redistributes its load.
You maintain an SCD Type 2 dimension. The source system updates records in place and reuses the same natural key, and there is NO reliable `updated_at` timestamp. You must detect real changes and close/open versions correctly. Which approach is most robust?
  • A. Compare the full row to the current version using a hash of all tracked attributes; if the hash differs, close the current row (set end_date) and insert a new current version ✓
  • B. Trust the source's `updated_at` column and only process rows where it is greater than the last load watermark
  • C. Truncate the dimension each run and reload it fully from the source's current state
  • D. Use `SELECT DISTINCT` on the natural key to remove duplicates before loading
Correct answer: A. With no trustworthy timestamp, a hash-based comparison of tracked attributes against the current version is the standard way to detect genuine changes and drive SCD2 version transitions.
A Kafka consumer group processes payments with `enable.auto.commit=true` and default `auto.commit.interval.ms=5000`. The application reads a batch, writes to a database, and occasionally crashes mid-batch. On restart you observe some payments were processed twice. What is the correct cause and fix?
  • A. Auto-commit can commit offsets for records that were fetched but not yet fully processed; disable auto-commit and commit offsets manually only after the DB write succeeds (ideally in the same transaction / idempotent write) ✓
  • B. The consumer has too few partitions; add partitions so each record is processed once
  • C. Set `isolation.level=read_committed` on the consumer to prevent duplicate processing
  • D. Increase `max.poll.interval.ms` so the consumer is not kicked out of the group during processing
Correct answer: A. Auto-commit advances offsets on a timer regardless of processing completion, so a crash after commit but before the DB write replays; manual commit after the sink write (plus idempotency) fixes it.
In a Flink event-time pipeline computing 1-minute tumbling windows of clickstream data, you set a bounded-out-of-orderness watermark of 10 seconds. Events routinely arrive up to 3 minutes late due to mobile clients going offline. What is the observable consequence of this configuration?
  • A. Windows will never fire because the watermark can never advance past late events
  • B. Late events beyond the 10-second bound are dropped (or diverted to side output), so window aggregates for those minutes are silently undercounted ✓
  • C. The watermark forces all late events into the current processing-time window, corrupting later windows
  • D. Flink automatically extends the watermark to 3 minutes once it detects the late events
Correct answer: B. A watermark defines when a window is considered complete and fired; events later than the 10s bound arrive after their window closed and are dropped unless captured via allowed lateness or a side output.
A nightly backfill job re-runs the last 30 partitions of a Delta table and appends rows with `INSERT INTO`. Operators frequently retry failed runs. You are seeing duplicated rows for reprocessed dates. Which change makes the job idempotent for safe reruns?
  • A. Add `OPTIMIZE` and `VACUUM` after each write to compact and remove duplicates
  • B. Switch the write to a `MERGE INTO ... WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT` keyed on the business+partition key, or replace-by-partition with `replaceWhere` ✓
  • C. Wrap the `INSERT INTO` in a `try/except` so failed runs do not append
  • D. Enable Delta's automatic schema evolution with `mergeSchema=true`
Correct answer: B. An append is inherently non-idempotent on retry; a keyed MERGE or a partition-scoped overwrite (`replaceWhere`) makes reprocessing produce the same final state regardless of how many times it runs.
A real-time fraud system must return a decision in under 100ms at ~5,000 events/sec with strict correctness on account balances. A teammate proposes exactly-once end-to-end via a two-phase-commit sink to the downstream API. Under the latency SLA, which reasoning is soundest?
  • A. Exactly-once via 2PC is always required for money, so accept the latency cost of the transactional coordinator
  • B. Use at-least-once delivery with an idempotent sink (dedup by event_id/request key), since 2PC's coordination adds latency and the idempotent sink prevents duplicate effects ✓
  • C. Use at-most-once to guarantee sub-100ms, accepting that some fraud events are dropped
  • D. Exactly-once and at-least-once are identical in throughput, so pick based on team familiarity
Correct answer: B. Distributed transactional commit adds coordination latency that threatens the SLA; at-least-once plus an idempotent (dedup-keyed) sink achieves effectively-once results without the 2PC cost.
You register Avro schemas in a Schema Registry set to BACKWARD compatibility. A producer team wants to add a new field `loyalty_tier` to an event that existing consumers must keep reading without redeployment. What must they do for the change to be accepted and safe?
  • A. Add `loyalty_tier` as a required field with no default; BACKWARD compatibility allows adding required fields
  • B. Add `loyalty_tier` with a default value so consumers using the new schema can read old data lacking the field ✓
  • C. Rename the event's existing `tier` field to `loyalty_tier`; renames are backward compatible
  • D. Remove an unused optional field in the same change to offset the addition
Correct answer: B. Under BACKWARD compatibility a new-schema reader must read data written with the old schema, which requires the added field to have a default so missing values resolve.
A dbt model deduplicates a CDC stream keyed on `order_id`, keeping the latest state per key. The current SQL is `SELECT DISTINCT * FROM raw_orders`. Analysts report both stale and current versions of some orders appear. What is the correct fix?
  • A. `SELECT DISTINCT ON (order_id) * FROM raw_orders ORDER BY order_id` in standard ANSI SQL
  • B. Use `ROW_NUMBER() OVER (PARTITION BY order_id ORDER BY event_ts DESC, op_seq DESC)` and keep rows where the rank = 1 ✓
  • C. Add `GROUP BY order_id` and select the remaining columns without aggregation
  • D. Replace `SELECT DISTINCT *` with `SELECT DISTINCT order_id`
Correct answer: B. `DISTINCT *` only removes fully identical rows, so different versions of the same order survive; windowing by key ordered by event time/sequence and keeping rank 1 selects the true latest state.
A daily pipeline technically succeeds every run (no errors, no failed tasks), but a downstream revenue dashboard shows a 40% drop for one region. Investigation reveals an upstream API silently started returning `null` for `amount` on ~40% of that region's rows. Which control would have caught this BEFORE the dashboard did?
  • A. A retry policy with exponential backoff on the extraction task
  • B. A data-quality assertion on null-rate / distribution of `amount` per region that fails or alerts when it deviates from the historical baseline ✓
  • C. Increasing the Airflow task timeout so the job has more time to complete
  • D. A schema check that the `amount` column still exists and is numeric
Correct answer: B. The job succeeded and the schema was unchanged, so only a value-level quality check (null-rate/volume anomaly vs. baseline) detects a silent correctness failure of this kind.
An Airflow DAG has a task `load_gold` that reads yesterday's silver partition. It is configured with `retries=3` and `depends_on_past=False`, and the sensor waiting on the silver partition uses `poke` mode with a 6-hour timeout. During a Spark cluster outage, dozens of DAG runs pile up and worker slots are exhausted. What is the primary design flaw?
  • A. `depends_on_past=False` caused the runs to execute out of order
  • B. `retries=3` is too low for a production pipeline and should be increased
  • C. The `poke`-mode sensor holds a worker slot for up to 6 hours while idle-waiting, causing slot starvation; use `reschedule` mode (or a deferrable sensor) ✓
  • D. The DAG needs `catchup=False` to prevent it from scheduling multiple runs
Correct answer: C. A poke-mode sensor occupies a worker slot the entire time it waits, so long timeouts across many runs exhaust the pool; reschedule/deferrable sensors free the slot between checks.

Prep for another role

Questions are original, written and independently verified for HireHire's role interview quizzes. They reflect the kind of knowledge Data Engineer interviews test, not any specific company's questions. HireHire maps live tech & IT jobs across India, updated regularly. Last updated: July 2026.