Dodomeki

Data engineering interview questions on SQL and pipelines

In a data engineering interview, define the grain of the output first. Then explain how you'll handle duplicate events, late arrivals and reprocessing. Finish with the checks that would detect a result that looks plausible but is wrong.

How do you pick the latest row per customer in SQL?

Use ROW_NUMBER() partitioned by customer_id and ordered by updated_at DESC and a deterministic tie-breaker such as event_id DESC. Keep rank 1. State how null timestamps are handled and whether the tie-breaker really encodes recency or only makes equal timestamps deterministic.

Follow-up · How would you test that a join downstream hasn't duplicated customers again?

How do you make an incremental pipeline safe to rerun?

Persist a stable source key and deduplicate before an upsert, or replace bounded partitions atomically. Advance the processing watermark only after a successful write. Rerun the same input and compare record counts, uniqueness and outputs. For a backfill, bound the dates and audit changed partitions.

Follow-up · What happens if a run writes half its output and then crashes?

What is your policy for late events?

Measure observed arrival delay and agree how fresh the dashboard must be. Recompute affected windows within a defined delay, and record exceptions beyond it for explicit backfill. Track freshness, volume and late-event rate separately so users know whether a metric might still change.

Follow-up · How would you reconcile an already reported metric when a late event changes it?

Practice out loud

Describe a pipeline you've operated, name its output grain and explain how you would rerun yesterday's data without double-counting.

Start a free mock interview