Design batch and streaming ETL pipelines
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Meta's system design round, last asked Jul 2025. It tests data engineering, etl and streaming.
Design a data platform for product analytics that ingests product events, cleans them and aggregates them into tables analysts query. It must support daily batch processing and near real-time streaming. This is a data engineering design, so table design, update patterns and data quality matter as much as the boxes.
Requirements
- Functional: ingest events from apps and services (and change data from production databases); keep raw, staging and modelled layers; build daily, hourly and rolling-window metrics; serve a near real-time view of key metrics; support backfills.
- Non-functional: state your scale (events per day, peak rate); freshness targets for batch (daily SLA) and streaming (minutes); correctness under duplicates, late and out-of-order events; recovery from failed runs; reasonable cost.
Clarifying questions
- What are the sources and formats: client events, server logs, database changes? How large is the volume?
- Which metrics must be real-time, and which are fine daily?
- How late can events arrive, and how long must late data still change the numbers?
- Which dimensions change over time (user country, plan) and do analysts need their history?
- Who consumes the tables: dashboards, ad hoc SQL, ML features?
What a strong answer covers
- Ingestion through a durable log (a message queue or stream) with a schema registry, landing raw data append-only and partitioned by event date.
- Layered tables: raw, cleaned staging (deduplicated by event id, typed, validated), and modelled facts and dimensions, with partitioning and clustering chosen for the common queries.
- Update patterns: append-only facts versus upsert or merge for entities; slowly changing dimensions type 1 (overwrite) and type 2 (validity ranges) and when each fits.
- Idempotency: every batch job overwrites its partition, so reruns and backfills give the same result; streaming uses event-time windows, watermarks and an allowed lateness, with the batch layer correcting late data.
- Orchestration with dependencies, retries and alerting; data quality checks (row counts, null rates, uniqueness, freshness, reconciliation between stream and batch) that block publishing.
- The trade-off between latency, cost and complexity, decided per metric.
Follow-ups
- A bug corrupted three days of a fact table. Walk through the backfill without breaking downstream tables.
- The streaming count and the daily batch count for yesterday disagree by 2%. How do you investigate?
- A source adds a field and renames another. How does the pipeline handle the schema change?
- How do you compute daily active users over a rolling 28 days cheaply?
Where it's asked
- Meta · System design · Last asked Jul 202545 min · Design discussion; either an LLM-agent system or a classic product system · Nominally AI-enabled, but the assistant is often not used
What it tests
data engineering · etl · streaming · batch processing
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
