Skip to main content
EngineeringUpdated 2026

Data Engineer Interview Questions & Answers (2026)

Data engineers design, construct, and scale robust data pipelines, distributed storage architectures, and real-time streaming infrastructure. In India, data engineers bridge raw ingestion with analytical consumption across Tier-1 GCCs, fintech platforms, and big-data startups.

₹10–22 LPA

Mid-level pay

11+

Core skills

8

Top employers

8

Interview Q&As

Real Data Engineer interview questions with answers

These are the questions that actually decide Data Engineer interviews in India — practice answering out loud before your next round.

Q1.How do you diagnose and resolve data skew in Apache Spark join operations?

Data skew occurs when uneven data distribution causes one or few Spark partitions to process disproportionately larger data volumes, manifesting in Spark UI as 99% task completion with one hanging straggler. Strategies to resolve skew include: (1) Broadcast Joins: If one dataset is under the broadcast threshold (spark.sql.autoBroadcastJoinThreshold, default 10MB, safe up to a few GBs), broadcast it to avoid shuffle. (2) Salting: Add a random prefix/salt key (e.g. 0 to N-1) to the skewed join key in the large table and replicate rows in the smaller table with all salt values, distributing partition load evenly across executors. (3) Adaptive Query Execution (AQE): Enable spark.sql.adaptive.skewJoin.enabled = true in Spark 3+, which automatically splits skewed shuffle partitions into smaller sub-partitions at runtime.

Q2.Explain Kafka consumer rebalancing, consumer lag metrics, and how to achieve exactly-once processing (EOS).

Consumer rebalancing occurs when a consumer group member joins, crashes, or heartbeat expires (max.poll.interval.ms exceeded), triggering the Group Coordinator to redistribute partition assignments across consumers. Rebalance storms stall streaming throughput; mitigate them using CooperativeStickyAssignor which incrementally reassigns partitions without stopping unaffected consumers. Consumer lag measures the offset difference between the latest produced message (Log End Offset) and the committed consumer offset; persistent lag indicates insufficient consumer parallelism or slow downstream I/O. To achieve Exactly-Once Semantics (EOS), use Kafka Streams or transactional producers (isolation.level = read_committed, enable.idempotence = true), ensuring atomic multi-partition writes across consume-transform-produce loops.

Q3.How do you design Slowly Changing Dimensions (SCD Type 2) in modern cloud data warehouses like Snowflake or BigQuery using dbt?

SCD Type 2 tracks historical changes by creating a new dimension record with valid_from, valid_to timestamps and an is_current boolean flag whenever an attribute changes. In dbt, use the dbt snapshot command configured with strategy = 'check' (monitoring specific change columns) or strategy = 'timestamp' (monitoring an updated_at column). Under the hood, dbt generates an idempotent MERGE SQL statement: it matches incoming source rows with existing target dimension records on the natural key. If attributes differ, it closes the existing record (setting valid_to = current_timestamp and is_current = false) and inserts a new active row (valid_from = current_timestamp, valid_to = NULL, is_current = true), guaranteeing complete auditability without data duplication.

Q4.What is the difference between Delta Lake, Apache Iceberg, and Apache Hudi Lakehouse table formats?

All three provide ACID transactions, schema enforcement, time travel, and metadata optimization over cloud object storage (Parquet on S3/GCS). Key differences: (1) Delta Lake: tightly integrated with Apache Spark and Databricks; maintains a JSON-based transaction log (_delta_log) checkpointed with Parquet; features Z-Order clustering and Liquid Clustering. (2) Apache Iceberg: engine-agnostic by design (equal first-class support across Trino, Flink, Spark, Snowflake); uses hierarchical metadata trees (snapshot -> manifest list -> manifest file -> data files), excelling at hidden partitioning and schema evolution. (3) Apache Hudi: excels at fast upserts and incremental consumption for near-real-time CDC ingestion via Copy-on-Write (COW) and Merge-on-Read (MOR) storage modes.

Q5.How does Apache Spark's Catalyst Optimizer work and how does Adaptive Query Execution (AQE) optimize runtime plans?

Catalyst processes DataFrames through four stages: (1) Analysis: resolves unresolved attributes and relations against the Catalog. (2) Logical Optimization: applies rule-based optimizations such as predicate pushdown (filtering at storage level), projection pruning, and constant folding. (3) Physical Planning: maps the optimized logical plan to physical operators (e.g. SortMergeJoin vs BroadcastHashJoin). (4) Code Generation: compiles Whole-Stage Java bytecode using Janino to run at hardware speed. Adaptive Query Execution (AQE) operates between stages during runtime: it uses actual shuffle stage map statistics to dynamically coalesce shuffle partitions (reducing small partition overhead), convert SortMergeJoin to BroadcastHashJoin if data post-filter is small, and split skewed partitions.

Q6.How do you handle backpressure and windowing in streaming data pipelines with Spark Streaming or Flink?

Backpressure occurs when downstream sink writing or processing rates fall behind the message ingestion rate, risking executor Out-Of-Memory (OOM) crashes. In Spark Structured Streaming, backpressure is managed via spark.streaming.backpressure.enabled and PID rate estimators that throttle the Kafka consumer's maxOffsetsPerTrigger. In Apache Flink, backpressure is handled natively through credit-based flow control at the Netty network layer. Windowing models include: (1) Tumbling: fixed, non-overlapping time intervals. (2) Sliding: fixed-length windows that advance by a slide duration (e.g. 10m window every 1m). (3) Session: windows demarcated by inactivity gaps. Late data is handled using watermarks: events older than (event_time - allowed_lateness) are dropped or routed to dead-letter queues.

Q7.Explain partition pruning, clustering keys, and micro-partitions in Snowflake / BigQuery.

In cloud data warehouses, tables are stored in immutable columnar files (Snowflake micro-partitions, 50–500MB uncompressed). Each micro-partition stores min/max statistics for every column in the header metadata. When a query contains a WHERE clause, the query planner executes partition pruning by inspecting the metadata without reading the underlying storage blocks, completely skipping irrelevant micro-partitions. Clustering keys define the physical sort order of data across micro-partitions. If queries regularly filter on (tenant_id, created_at), setting that composite clustering key groups correlated data together, maximizing pruning efficiency, drastically reducing byte scanning, and cutting query costs by 70–90%.

Q8.How do you ensure idempotency in Apache Airflow DAGs when dealing with upstream backfills and transient task failures?

An idempotent task produces the identical state regardless of how many times it runs with the same parameters. In Airflow: (1) Never use datetime.now() inside tasks; strictly bind to execution date macros ({{ data_interval_start }}, {{ ds }}). (2) In SQL/Warehouse tasks, replace naive INSERT INTO with atomic DELETE WHERE date = '{{ ds }}' followed by INSERT, or use MERGE / CREATE OR REPLACE TABLE partitions. (3) For S3/GCS file outputs, write to deterministic partition prefixes (e.g. s3://bucket/data/dt={{ ds }}/) with atomic rename or overwrite flags. (4) For external REST APIs, supply an idempotency_key computed from task_id and ds to prevent duplicate side effects.

Preparation tips from hiring managers

  • ✓Expect live SQL coding involving complex window functions, CTEs, self-joins, and aggregation over date ranges.
  • ✓Be prepared to draw a distributed streaming vs batch architecture on a whiteboard, explaining message deduplication and dead-letter queues.
  • ✓Know the internal mechanics of Spark: Catalyst optimizer, DAG execution, RDD lineage, memory management (execution vs storage memory), and garbage collection.
  • ✓Highlight cost optimization and data governance: partition strategies, data quality contracts, and schema evolution.

Get your Data Engineer application interview-ready

Score your resume against real ATS software free, then book a 1:1 session with a senior engineering mentor for line-by-line feedback.

More Data Engineer guides

Related career guides

ProMyCareer career guides are written and reviewed by hiring managers and senior practitioners. Salary data reflects verified 2026 Indian market ranges.