Pipeline system design
"Design a pipeline that…" is the round that decides most senior offers. There's no single right answer. The interviewer wants to see you turn vague requirements into a working, operable design, and reason about trade-offs as constraints change.
The design template
Every worked design here follows the same steps. Use them as your checklist in the interview.
- Requirements. Who consumes the data, and for what decision? Freshness (seconds, minutes, daily)? Volume now and in two years? Correctness needs (approximate is fine vs money-exact)? History and retention?
- Data contracts. What exactly does the source promise: schema, keys, ordering, delivery guarantees, how it signals deletes? Who is told when it changes?
- Ingestion. Batch pull, push via API, a log or queue, or CDC. How do you get data in without hurting the source?
- Storage and format. Raw (immutable, replayable) vs modeled. File format (Parquet), table format (Iceberg, Delta, Hudi) or warehouse tables. Partitioning and clustering.
- Transform. Engine (SQL in the warehouse, Spark, Flink, dbt) and the modeled tables with their grain.
- Serving. BI, an API, a feature store, reverse ETL. Latency and concurrency needs.
- Quality. Tests at each layer, contracts, reconciliation against the source, anomaly alerts, and where bad data goes (quarantine).
- Orchestration and backfill. Scheduling, dependencies, idempotent re-runs, how you backfill a month safely.
- Failure modes. What breaks first? Source down, late data, duplicates, schema change, a bad deploy. How do you detect and recover?
- Cost. What dominates the bill, and the dials you'd turn.
- What changes at 10×. Volume, consumers or freshness. Which parts survive and which you'd redesign.
Running the 45 minutes
| Minutes | What to do |
|---|---|
| 0–8 | Requirements and numbers. Write them on the board. Confirm the top two priorities. |
| 8–15 | High-level diagram, sources to consumers, five or six boxes. |
| 15–30 | Deep dive on the hardest part (usually ingestion semantics, late data or the core model). |
| 30–40 | Quality, failure modes, backfills, monitoring. |
| 40–45 | Cost, 10×, and what you'd do differently with more time. |
Ask the interviewer where they want depth. It's a good question, not a weakness.
Numbers worth knowing
Rough figures for back-of-envelope estimates. They vary a lot by provider and configuration, so state them as assumptions.
- 1 billion events/day ≈ 11,600/second on average; plan for 3–5× peaks.
- At 1 KB per event, 1 billion events ≈ 1 TB/day raw JSON, often 5–10× smaller as compressed Parquet.
- A single Kafka partition comfortably handles thousands to tens of thousands of small messages per second. Choose partition counts for peak throughput and consumer parallelism.
- Small files hurt. Aim for Parquet files in the hundreds-of-MB range, and plan compaction.
Worked designs
- Clickstream to warehouse: high-volume events, late data, raw vs modeled.
- CDC from Postgres to the lakehouse: log-based capture, MERGE, deletes, schema changes.
- Payments ledger reconciliation: matching, control totals, auditability.
- Daily batch with backfills: idempotency, logical dates, write-audit-publish.
- Late and out-of-order events: event time, watermarks, stream plus batch.
- Cut a runaway warehouse bill: cost attribution, right-sizing, guardrails.
- Real-time fraud features: streaming aggregates, online store, training/serving parity.
- GDPR delete across a lake: data inventory, row deletes, crypto-shredding, proof.
- Multi-tenant SaaS analytics: tenant isolation, OLAP serving, noisy neighbors.
- Legacy to cloud migration: inventory, waves, parity harness, cutover.
Real-world designs
Interviewers love "have you seen how a company like X does this?". DataEngReads collects case studies from company engineering blogs, filterable by problem, stack and scale. Reading two or three for the kind of system you're designing gives you concrete trade-offs to cite.
- Design a batch lakehouse on AWS
- Replicate a production Postgres into the lakehouse with CDC
- Design a clickstream pipeline from apps to the warehouse
- Cut a runaway warehouse bill
- A daily batch pipeline that can be backfilled safely
- Design data quality and observability for a data platform
- GDPR delete across a data lake
- Real-time metrics with late and out-of-order events
- Legacy (Teradata / Ab Initio) to cloud migration
- Multi-tenant SaaS analytics
- Design a reliable partner file ingestion pipeline
- Reconcile the internal payments ledger with processor settlements
- Real-time fraud features
- Keep dashboards fast while loads and ad-hoc queries compete
Further reading
- Tyler Akidau: Streaming 101: event time, processing time and windows, from one of the authors of Google's Dataflow model. Read it before any streaming design.
- Databricks: what is a lakehouse?: the vendor's own case for the lakehouse; read it to argue for or against one.
- Martin Kleppmann: please stop calling databases CP or AP: read this if an interviewer asks about CAP and you want a sharper answer than "pick two".