Skip to content

Data Engineer interview questions

100 real questions with model answers and explanations for Middle candidates.

See a Data Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

querieswarehouseoptimization

I optimize this regression by profiling the execution plan before changing SQL.

  • I compare the current profile with a known fast run and look for lost partition pruning, row explosion in a join, skew, or spilling caused by insufficient memory.
  • I apply the fix indicated by the profile, such as filtering the raw partition column, pre-aggregating a large join input, correcting join order, or removing duplicate join keys.
  • I also compare row counts and recent loads because a backfill or accidental duplication can explain the slowdown better than a query rewrite.

Why interviewers ask this: Reading the engine's query profile before touching SQL separates systematic optimizers from people who sprinkle hints and hope.

partitioningmodelingclustering

I choose partitioning and clustering from actual access patterns, then verify the result with scan metrics.

  • I usually partition a large fact table by event date because it dominates filters and retention, allowing the engine to prune old data and remove periods cheaply.
  • I choose clustering keys from the next most frequent filter and join columns in query history, such as tenant, customer, or product, rather than relying on intuition.
  • I avoid excessive partitioning and clustering because tiny files, metadata overhead, and reclustering consume resources, and I compare bytes scanned on representative queries before and after the change.

Why interviewers ask this: Deriving keys from query history and validating with scanned-bytes metrics shows the empirical loop that distinguishes engineering from folklore.

joins

When one worker becomes a straggler, I first suspect data skew on the join key.

  • I count rows per key on both inputs to find hot values such as NULL, a default tenant, or one unusually large customer.
  • I process NULL or otherwise irrelevant keys separately and broadcast the smaller table when it fits in memory, which can eliminate the shuffle.
  • For unavoidable hot keys I use salting on both sides to split the work, while treating adaptive execution as helpful protection rather than a substitute for fixing the data shape.

Why interviewers ask this: Naming null and whale keys as the usual culprits and salting as the remedy shows hands-on experience with skewed joins rather than textbook parallelism.

schemawarehouse

Selecting every column defeats a major performance advantage of a columnar warehouse.

  • A columnar engine reads only referenced columns, so select-star on a wide event table can turn a small logical request into terabytes scanned and substantial compute cost.
  • It also weakens data contracts because downstream models silently inherit new columns and can fail far from the source after a rename.
  • I require explicit column lists in pipeline models and enforce them with linting or dbt conventions, while allowing select-star only for temporary interactive exploration.

Why interviewers ask this: Connecting column pruning to the billing model and to contract stability shows the candidate operates warehouses, not just queries them.

ci-cd

The likely cause is join fanout after a supposedly unique key became one-to-many.

  • A duplicate dimension row makes each matching fact row appear multiple times, so downstream sums can double while still looking plausible.
  • I add uniqueness tests for dimension join keys and fail the dbt build before consumers receive data when the expected cardinality is violated.
  • I also declare model grain explicitly and compare input and output row counts whenever a transformation is expected to preserve that grain.

Why interviewers ask this: Automated uniqueness and grain-preservation checks as standing defenses, rather than post-incident vigilance, mark production pipeline maturity.

materialized-viewsci-cd

I choose between these options based on transformation complexity, refresh control, and governance needs.

  • Engine materialized views fit simple, frequently queried aggregations over one table when automatic incremental refresh is supported and removes orchestration work.
  • Pipeline-maintained summary tables fit multi-table joins, window functions, and business rules that need testing, versioning, lineage, and refreshes coordinated with upstream loads.
  • As a rule, data used for business decisions goes through the tested pipeline, while materialized views remain an acceleration layer for well-understood hot queries.

Why interviewers ask this: The orchestration-alignment and testability arguments show the choice made on operational grounds, not feature checklists.

warehouse

I start by attributing the increase to specific workloads instead of applying platform-wide limits blindly.

  • I aggregate query history by user, service account, and query fingerprint to find frequent full scans, overly frequent dbt rebuilds, forgotten development warehouses, and accidental cross joins.
  • I then tune platform controls such as auto-suspend, warehouse sizing by workload, on-demand versus reserved BigQuery slots, and scanned-bytes budgets with alerts.
  • I tag queries by pipeline and team so recurring costs have owners and future regressions can be detected quickly.

Why interviewers ask this: Fingerprint-level query analysis plus cost attribution to owners shows platform cost treated as an operated system rather than a finance surprise.

joins

I preserve fact completeness by mapping missing dimension references to explicit fallback members.

  • A NULL dimension key disappears from an inner join, so grouped metrics can lose fact rows and stop reconciling with source totals.
  • Each dimension gets reserved surrogate rows for states such as unknown and not applicable, and the load maps NULL or unmatched natural keys to the appropriate row.
  • This keeps joins complete and makes unmatched volumes measurable, while separating missing source data from failed matching because those cases need different upstream fixes.

Why interviewers ask this: The unknown-member pattern with monitoring on its volume is the warehouse-craft answer that survives reconciliation audits.

warehousequeriesci-cd

I deduplicate once in staging, as close to ingestion as practical.

  • I define duplicates with the source owner, then use row_number over the business key ordered by source timestamp and a deterministic tiebreaker to retain the newest record, using QUALIFY where supported for a clear implementation.
  • The processing window covers the source's real redelivery horizon because late duplicates can make a previously clean partition incorrect again.
  • I record the duplicate rate for every load and alert on spikes, which often reveal an upstream retry storm before other symptoms appear.

Why interviewers ask this: Windowed dedup with a redelivery horizon and duplicate-rate monitoring shows the temporal dimension of the problem understood, not just the SQL idiom.

warehouseetl

Surrogate keys isolate warehouse identity from unstable source identifiers and support multiple historical versions.

  • Natural keys may be reused, may differ across source systems, and cannot uniquely identify several SCD2 rows for the same business entity.
  • In a modern ELT pipeline I often use a deterministic hash of the source system, source identifier, and, for SCD2 rows, the version's effective timestamp, which stays stable across parallel reruns and avoids sequence lookups.
  • I document the key inputs and use a strong hash because hashes are harder to inspect manually and collisions, although unlikely, remain theoretically possible.

Why interviewers ask this: Choosing deterministic hashes for idempotent parallel loads, with the trade-offs stated, reflects current ELT practice rather than legacy sequence habits.

transactionssnapshot

I choose the fact type according to whether the business question concerns events, states at intervals, or progress through milestones.

  • Transaction facts store one row per event at the finest useful grain, such as an order, payment, or click, and are the default because other views can often be derived from them.
  • Periodic snapshots store state at regular intervals, such as daily inventory or month-end balances, when historical levels are expensive or impossible to reconstruct from events.
  • Accumulating snapshots keep one row per process and update milestone dates such as placed, paid, shipped, and delivered, making duration analysis easy but creating workloads that are awkward for append-oriented warehouses.

Why interviewers ask this: Knowing accumulating snapshots exist and why their update pattern clashes with modern warehouses signals real dimensional modeling depth.

joinsqueries

I keep the history but separate expensive historical access from common current-state queries.

  • I identify attributes causing most versions, and move a volatile score or status into a mini-dimension or fact when it does not belong in the slowly changing core.
  • I maintain a current-only view or table filtered by the active flag so everyday consumers join to one row per customer while full history remains available.
  • For heavy point-in-time marts I materialize the effective version rather than recalculating validity-range joins in every query.

Why interviewers ask this: Diagnosing the churn driver and splitting volatile attributes, rather than accepting version bloat, shows dimensional modeling operated under performance constraints.

schemawarehouse

I promote frequently queried and semantically stable JSON fields to typed columns while retaining the variable long tail.

  • Fields used in filters, joins, and metrics become typed staging columns so the engine can use statistics and pruning, and type errors are caught early.
  • Rare or genuinely variable attributes remain semi-structured because flattening them would create hundreds of sparse columns and frequent schema migrations.
  • I maintain an extraction contract listing promoted paths, data types, and null rules, and marts reference those columns rather than parsing raw JSON repeatedly.

Why interviewers ask this: Flatten-the-queried, keep-the-tail with a promotion contract shows semi-structured data handled as a lifecycle, not a one-time schema decision.

monitoringiacsoft-skills

I make timezone and calendar rules explicit data-model decisions rather than repeating them in report queries.

  • I store timestamps in UTC and derive a business date through a declared reporting timezone during loading or staging, which prevents inconsistent midnight-boundary conversions.
  • A maintained date dimension supplies fiscal periods, week boundaries, and holidays so models do not duplicate fragile calendar arithmetic.
  • I define handling for 23-hour and 25-hour DST days, reject or repair local timestamps without offsets at ingestion, and model a separate local business date per market when one event belongs to different reporting dates.

Why interviewers ask this: Materializing the business date once and centralizing calendar logic in a date dimension shows the engineering answer to a class of bugs analysts usually discover.

schemanormalizationmodeling

I design the star schema around business processes and declared grains, not by translating all source tables directly.

  • I identify measurable events such as order lines, payments, or resolved tickets and state the grain of each fact table explicitly.
  • I gather descriptive context into denormalized customer, product, and date dimensions, reducing the deep joins required by the normalized OLTP schema.
  • Facts reference dimensions through surrogate keys and contain additive or clearly documented semi-additive measures.
  • I deliver one business process end to end first, then extend shared conformed dimensions as additional processes are modeled.

Why interviewers ask this: Grain-first process orientation and deliberate denormalization of dimensions show Kimball methodology applied, not just referenced.

Conformed dimensions give different marts one shared identity and vocabulary for core entities.

  • Sales and support facts use the same customer and date keys, so cross-mart measures agree on which entity and period they describe.
  • Separate team-owned copies quickly diverge in deduplication, freshness, and attribute definitions, producing incompatible counts and unreliable cross-domain joins.
  • I treat core dimensions as owned, versioned data products with one build path, and marts reference them instead of copying their logic.

Why interviewers ask this: Framing conformed dimensions as owned products consumed by reference, with the cross-mart failure mode named, shows warehouse governance at working level.

schemamodeling

I model this relationship with an order-promotion bridge table and explicit allocation semantics.

  • The bridge contains one row for each promotion applied to an order, plus an allocation factor when a measure such as discount must be split.
  • Joining facts through the bridge multiplies order rows, so unweighted revenue by promotion will overstate totals unless the metric is explicitly non-additive across promotions.
  • I document the fanout and provide a pre-allocated mart for common promotion analysis so consumers do not repeatedly implement the risky join themselves.

Why interviewers ask this: Knowing bridge tables introduce intentional fanout and shipping allocation factors plus pre-built marts shows many-to-many handled beyond the diagram.

ci-cd

The layers separate source mechanics, shared business meaning, and consumer-specific presentation.

  • Staging standardizes names and types and handles source-level deduplication, usually with one model per source table.
  • Core applies business rules once to create conformed entities and facts, while marts shape those trusted results for particular consumers.
  • This structure contains source schema changes, prevents business logic from being copied into dashboards, and lets debugging proceed through small understandable steps instead of one large transformation.

Why interviewers ask this: Assigning each layer a single change-absorption role shows the architecture understood as maintenance economics rather than convention.

schemamodeling

A wide table wins as a serving artifact for a defined consumer, but not as the authoritative model.

  • At a clear grain it gives BI users one pre-joined dataset, prevents join fanout mistakes, and performs well in columnar engines.
  • As a system of record it is expensive to rebuild, fixes history semantics at build time, and encourages divergent copies for teams with slightly different needs.
  • I keep shared semantics in a star-schema core and generate replaceable wide tables from it for specific tools or teams.

Why interviewers ask this: Wide-tables-as-generated-serving-layer over a modeled core resolves the false dichotomy and shows layered thinking about where semantics live.

warehousesystem-design

Delete handling must be part of the ingestion contract because timestamp-only incrementals cannot observe missing rows.

  • Log-based CDC is the preferred option because it emits delete events that the warehouse can apply as audited soft deletes or physical removals.
  • Without CDC, I periodically extract all source primary keys and anti-join them to warehouse keys, or negotiate soft-delete markers in the source, accepting the cost and schedule-based freshness.
  • I explicitly document that updated_at extraction alone is insufficient because a deleted record has no later timestamp to enter the delta.

Why interviewers ask this: Naming the deleted-rows-are-invisible-to-incremental trap and ranking the realistic options shows extraction design informed by actual source behavior.

Locked questions

  • 21

    Orders arrive in five currencies and finance wants consistent revenue reporting. How do you model money in the warehouse?

    warehouse
  • 22

    How do you decide whether a transformation belongs in the warehouse SQL layer or in the BI tool?

    sqlwarehouse
  • 23

    How do you choose among view, table, incremental, and ephemeral materializations for a dbt model?

    dbt
  • 24

    Walk me through how a dbt incremental model works and the choices among merge, delete+insert, and insert_overwrite.

    dbt
  • 25

    How do dbt snapshots implement SCD2, and what operational gotchas have you hit with them?

    snapshotdbt
  • 26

    Beyond unique and not_null, what does a serious dbt testing setup look like?

    dbt
  • 27

    Why does dbt insist on ref() instead of hardcoded table names, and what does that buy the project?

    dbt
  • 28

    Your dbt project takes 50 minutes to build, and PRs rebuild everything. How do you make CI fast and still trustworthy?

    ci-cddbt
  • 29

    What conventions keep a dbt project navigable as it grows past a few hundred models?

    dbt
  • 30

    When do Jinja macros in dbt help, and when do they make a project worse?

    dbt
  • 31

    How do dbt sources and freshness checks fit into pipeline reliability?

    dbtci-cd
  • 32

    You changed the logic of a large incremental model and history is now inconsistent with new runs. How do you backfill safely and affordably?

    backfill
  • 33

    What makes an Airflow DAG idempotent, and which common patterns silently break that property?

    airflowidempotency
  • 34

    Explain Airflow backfill mechanics: catchup, depends_on_past, and what you configure before reprocessing three months of history.

    configairflowbackfill
  • 35

    Sensors waiting on external data have started starving your Airflow workers. What is happening and what are the fixes?

    airflow
  • 36

    How do you configure retries and failure alerting for a production DAG so real problems surface and noise does not?

    configalerting
  • 37

    Why is XCom the wrong tool for passing datasets between Airflow tasks, and what is the right pattern?

    airflow
  • 38

    A colleague proposes generating DAGs dynamically from a database table of configurations. What do you weigh before agreeing?

    databaseconfig
  • 39

    Your daily pipeline finished green, but the data it delivered was three days old. How do you catch this class of silent failure?

    ci-cd
  • 40

    How do you decide task granularity in a DAG: one big task or many small ones?

  • 41

    Pipeline B must run after pipeline A's data is ready, but they live in different DAGs. What are your options and their trade-offs?

    ci-cd
  • 42

    You inherit five cron scripts doing nightly loads. What changes when migrating them into an orchestrator, beyond scheduling?

    jobsorchestrationownership
  • 43

    Explain how topics, partitions, and consumer groups give Kafka its parallelism model.

    partitioningkafka
  • 44

    How do you choose a partition key for a Kafka topic, and what goes wrong with a bad choice?

    partitioningkafka
  • 45

    Consumer lag on a critical topic is growing steadily. Walk me through diagnosis and remedies.

  • 46

    At-least-once versus exactly-once in Kafka pipelines: what do you actually rely on in practice?

    kafkaci-cd
  • 47

    How do consumer offset commits interact with failure recovery, and what does commit timing decide?

  • 48

    What does a schema registry add to a Kafka setup, and how do compatibility modes shape producer-consumer evolution?

    schemakafkaregistries
  • 49

    The team wants streaming because it sounds modern, but the dashboard updates hourly. How do you frame the streaming-versus-batch decision?

    streamingbatch
  • 50

    Events arrive out of order and late in your streaming pipeline. What concepts and mechanisms handle this correctly?

    streamingci-cd
  • 51

    What do Kafka retention and log compaction each do, and when does a compacted topic become the right tool?

    retentionkafka
  • 52

    Your consumer group rebalances every few minutes and throughput collapses. What causes rebalance churn and how do you stop it?

    churnthroughput
  • 53

    Explain lazy evaluation in Spark: what actually happens between reading a dataframe and calling an action?

    pandas
  • 54

    Narrow versus wide transformations in Spark: why do shuffles dominate job cost, and how do you minimize them?

  • 55

    repartition versus coalesce in Spark, and how do you reason about the right partition count for a job?

    partitioningqueries
  • 56

    One Spark task runs twenty times longer than its siblings and the stage never finishes. How do you diagnose and fix the straggler?

  • 57

    Your Spark executors keep dying with out-of-memory errors. What are the usual causes and your order of investigation?

    memory
  • 58

    When does a broadcast join help in Spark, and what breaks when broadcasting goes wrong?

    joins
  • 59

    The data lake accumulated millions of small files and every query got slower. Where do small files come from and how do you fix them?

    queries
  • 60

    Why is Parquet the default format for analytical data, and what do row groups and predicate pushdown actually do for you?

  • 61

    What do table formats like Delta Lake and Iceberg add on top of raw Parquet in object storage?

  • 62

    For a given transformation job, how do you choose among pandas on one machine, Spark, and pushing the SQL down to the warehouse?

    sqlwarehousepandas
  • 63

    In a stack with both a data lake and a warehouse, what belongs in each, and where does the boundary blur?

    warehouse
  • 64

    Log-based CDC versus query-based extraction from an operational database: how do the trade-offs actually play out?

    databasequeries
  • 65

    You consume a CDC stream of row changes into the warehouse. How do you apply it correctly into query-ready tables?

    querieswarehouse
  • 66

    You extract incrementally from a paginated REST API. What state do you keep, and how do you make the extraction restartable?

    rest
  • 67

    When is a full reload the right choice over incremental loading, despite the cost?

    pipelines
  • 68

    A source system adds columns, changes types, and renames fields without warning. How do you make ingestion resilient to schema drift?

    schemasystem-designiac
  • 69

    How do you evolve the schema of a heavily-consumed warehouse table without breaking dashboards and downstream models?

    schemawarehouse
  • 70

    You must backfill three years of history through a pipeline built for daily increments. How do you execute this without wrecking production?

    backfillci-cd
  • 71

    Design the loading step so that a file landing twice, or a job retrying, never duplicates data in the warehouse.

    designresiliencewarehouse
  • 72

    A nightly feed delivers CSV files from a partner. What defensive engineering goes into ingesting files you do not control?

  • 73

    Where do you place data quality checks along a pipeline, and why does placement matter as much as the checks themselves?

    qualityci-cd
  • 74

    Great Expectations versus dbt tests: how do you decide what runs where, and what does each do better?

    dbtdata-qualitytesting
  • 75

    Row counts passed, uniqueness passed, yet the data was wrong: a filter change silently dropped a customer segment. What monitoring catches this class of issue?

    monitoring
  • 76

    A quality check fails mid-pipeline at 4 am. Should the pipeline stop, continue with warnings, or quarantine the bad rows? How do you decide?

    ci-cd
  • 77

    How do you test pipeline transformation code itself, not just the data it produces?

    ci-cd
  • 78

    What is a data contract with an upstream producer, and what goes into one beyond the schema?

    schemadata-contracts
  • 79

    Why does column-level lineage matter operationally, and when did lineage save you or when would it?

    schemalineage
  • 80

    A director reports that yesterday's revenue on the executive dashboard looks wrong. Walk me through your first hour as the data engineer on call.

  • 81

    How do you reconcile warehouse data against the source system to prove the pipeline is not losing or corrupting rows?

    warehousesystem-designci-cd
  • 82

    Which metrics do you track about the pipelines themselves, and what does each protect against?

    monitoringci-cd
  • 83

    Beyond rerunning a day safely, how do you design a whole multi-step pipeline so any step can be retried blindly by the orchestrator?

    designorchestrationci-cd
  • 84

    A pipeline dies at step three of five, having already written partial data. How does good design contain this, and what does recovery look like?

    aggregationdesignci-cd
  • 85

    Events regularly arrive up to five days late, but the business reads yesterday's numbers every morning. How do you engineer the pipeline around this?

    ci-cd
  • 86

    Facts loaded before their dimensions produce orphaned keys. How do you orchestrate and design around this dependency?

    designorchestrationdependencies
  • 87

    An analyst accidentally dropped a production mart table. What determines whether this is a five-minute fix or a disaster, and how do you prepare?

  • 88

    How do you promote pipeline changes from development to production so consumers never see a half-tested state?

    ci-cd
  • 89

    An analyst needs a new column in a core mart for a board meeting tomorrow, and the proper modeling would take a week. What do you do?

    schema
  • 90

    Half your sprint capacity goes to firefighting brittle legacy pipelines, and product keeps requesting new datasets. How do you argue for and execute stabilization?

    agilecapacityci-cd
  • 91

    You are on call and the critical overnight load fails at 6 am, two hours before executives read their dashboards. Walk me through your actions.

  • 92

    How do you communicate planned and unplanned data downtime to consumers who depend on your tables?

    communication
  • 93

    A source team keeps breaking your pipelines with unannounced schema changes, and they see it as your problem. How do you change the dynamic?

    schemaci-cd
  • 94

    You discover that a transformation bug you shipped three weeks ago has been silently understating a key metric. What do you do?

    monitoring
  • 95

    Product asks how long building a new ingestion pipeline will take, and you have not seen the source yet. How do you estimate honestly?

    estimationci-cd
  • 96

    What documentation do you maintain for the pipelines you own, and how do you keep it from rotting?

    documentationci-cd
  • 97

    You want the team to adopt a lakehouse table format like Iceberg, but the current setup works. How do you evaluate and introduce it responsibly?

    decision-making
  • 98

    An analyst insists metric logic should live in their BI tool where they can iterate fast, and you want it in the warehouse. How do you resolve this productively?

    warehousemonitoringiteration
  • 99

    A developer asks for a copy of the production customer table to test their feature. What is your response?

  • 100

    You inherit a five-year-old pipeline system with no documentation, three orchestrators, and the author long gone. What do your first three weeks look like?

    documentationownershipsystem-design