What is data pipeline idempotency and how do you design for it?

This tests resilient pipeline design under failure. A strong answer defines idempotency as identical output on repeated runs, highlights safe retries and partial failure recovery, and proposes idempotency keys with atomic writes for daily API loads.
What's really being asked
This question tests whether you understand resilience in data pipelines beyond basic ETL concepts. Interviewers want to see if you recognize that failures are inevitable when you do not control upstream systems, and that reruns must not corrupt output. The focus is on practical design patterns for safe retries, partial failure recovery, and maintaining stakeholder trust in the data.
The full answer
First, define idempotency as the property that running an operation once or many times with the same input produces the same output. Second, explain why it matters: upstream APIs can be flaky, networks timeout, and mid-job crashes should not require manual cleanup. Third, describe implementation patterns in order: use idempotency keys such as a combination of data source and timestamp to detect duplicates; wrap multi-step writes in atomic transactions so a failure rolls back partial changes; use overwrite or merge semantics instead of blind appends for daily loads; and implement checkpointing to track discrete execution states so you can resume from the point of failure rather than restarting the entire job.
The mistakes people make
A major red flag is saying you would simply rerun the pipeline after any failure without deduplication logic. Another weak pattern is claiming that deleting all data before reloading is sufficient idempotency, because it ignores the window where downstream consumers see missing data. Saying idempotency is only about avoiding duplicates misses the broader need for consistent state and safe partial recovery.
What usually comes next
An interviewer might ask how you handle late-arriving data or backfills across multiple days without reprocessing everything. They may probe how you implement idempotency keys in a distributed system where clock skew exists, or how you enforce atomicity when your data lake does not support traditional transactions. You should also be ready to discuss tradeoffs between merge-on-read and copy-on-write for idempotent updates.
A concrete example
Suppose a daily batch job pulls financial records from a REST API and lands them as Parquet in a data lake partitioned by date. You would assign each run an idempotency key built from the API source name and the target partition date. Before writing, the job checks whether that partition already contains records with the same key. If the job fails after writing half the files, checkpointing metadata tells you exactly which partitions succeeded. On retry, the job skips completed partitions and overwrites the failed one atomically using a write-then-swap pattern, ensuring analysts see exactly one complete day of data.
Interview question
Which practice best ensures safe recovery from a mid-job crash in an idempotent daily batch pipeline loading API data into a partitioned data lake?
- a.Use an idempotency key per partition, checkpoint progress, and atomically overwrite only failed partitions on retryCorrect
- b.Append each run's output with a unique run ID and have downstream queries select the most recent batch
- c.Rerun the complete job after any failure and trust the pipeline to handle duplicates automatically
- d.Delete all data in the target partition before reloading to ensure a clean slate
Why? this is the answer
Checkpointing and atomic overwrites let retries resume exactly where they left off without corrupting data or exposing partial states. Deleting the partition first seems clean but creates a window where downstream consumers see missing data.
Just read this? Test yourself on what you have been reading.
Read the original → prefect.io
- #data engineering
- #idempotency
- #pipeline resilience
- #batch processing
- #data lakes
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on data engineering — each one lists the topics its interview covers.
See open roles