Disappearing Ink
An easy Pipeline Design interview practice problem on DataDriven. Design the pipeline on the canvas: sources, transforms, storage and checks, then get feedback on it.
- Domain
- Pipeline Design
- Difficulty
- easy
- Seniority
- mid
- Asked in
- Snap
Problem
An analytics lead keeps fielding the same complaint: a dozen teams need data shapes that the ingest already threw away, while about 10 billion engagement events a day (opens, replays, story views, ad views) keep arriving. Design the pipeline that builds the curated tables those teams query every morning.
Business requirements
- Our teams keep changing what they want from the data, so we do not want to decide the final shape before we even store it.
- A dozen teams query this data, and none of them should ever have to read the raw feed directly.
- When a day's data is malformed I do not want the analysts to be the ones who discover it.
- This has to run every day on its own and page someone when it does not.
Worked solution and explanation
The complaint in the prompt already names the fault: the ingest threw the data away. Whatever shaped these events on the way in kept only the fields someone wanted that month, and 12 teams have changed their minds since. The pattern that fixes it is ELT (extract, load, transform): store the events as they arrive, and do the transforming afterward, against a copy you can always go back to.
Storing before shaping
- engagement events (source, Kafka)
- raw landing (storage, object storage)
- batch transform (transform, Spark)
- quality gate (quality gate, Great Expectations)
- curated lakehouse (storage, Delta Lake)
- orchestrator (transform, Airflow)
- analytics teams (consumer, Metabase)
- on-call alerts (consumer)
- engagement events -> raw landing
- orchestrator -> batch transform
- raw landing -> batch transform
- batch transform -> quality gate
- quality gate -> curated lakehouse
- curated lakehouse -> analytics teams
- orchestrator -> on-call alerts
- Ingest: engagement events, raw landing
- Transform + gate: orchestrator, batch transform, quality gate, on-call alerts
- Serve: curated lakehouse, analytics teams
From event feed to morning tables
Step 1: Land every event untouched
Engagement events come off Kafka and go straight into the raw landing zone in object storage, partitioned by event date. Nothing is filtered, renamed or aggregated here, because any choice made at this point is one a team will want undone later. Object storage is cheap enough to keep 10 billion events a day for as long as the business cares about them.
Step 2: Shape it in a daily batch
The teams read these tables every morning, so nothing downstream needs data fresher than a day. The batch transform is a Spark job that reads yesterday's partition from the raw landing zone and builds the curated tables. Streaming it would buy freshness nobody asked for and leave you a harder system to re-run.
Step 3: Check the day before anyone sees it
The quality gate sits between the batch transform and the curated lakehouse. Row counts against the prior day, null rates on the keys, the set of event types present: if any check fails, the publish doesn't happen and the teams keep reading the last good tables. A gate placed after the publish can only report a problem the analysts have already queried.
Step 4: Publish where the teams read
Analytics teams connect to the curated lakehouse and nothing else; it holds the tables in Delta Lake. Raw stays private to the pipeline, so its layout can change and a table can be reshaped without 12 teams rewriting queries.
Step 5: Give the run an owner
The orchestrator starts the batch transform on a daily schedule and has an error path to on-call alerts. Alert on lateness as well as failure: a job that hangs never fails, and the morning still arrives with stale tables.
What a new request costs
- Shape at ingest
- The ingest job keeps the fields today's dashboards need and drops the rest. A new request means changing the ingest, and history comes back only for the days still inside the Kafka retention window. Everything older is gone.
- Land raw, shape later
- A new request is a new query over the raw landing zone. Run it across every past
event_datepartition and the table arrives with full history, while the ingest stays untouched.
-- Built from raw for a day the ingest never planned for
INSERT OVERWRITE TABLE curated.story_views_daily
PARTITION (event_date = '2026-03-01')
SELECT user_id,
story_id,
COUNT(*) AS views
FROM raw.engagement_events
WHERE event_date = '2026-03-01'
AND event_type = 'story_view'
GROUP BY user_id, story_id;Overwriting one event_date partition means a re-run or a backfill replaces that day instead of appending to it.
When one team needs data in 15 minutes
Common follow-up questions
- One team now needs its table within 15 minutes of the event. What do you change?
Add a streaming job off the same Kafka topic for that one table and leave the daily batch as the record everyone else reads. Freshness requests usually arrive for a single dashboard, and rebuilding the whole pipeline around it makes the other 11 teams carry the cost.
- The transform dies halfway through and you re-run it. Do the teams see duplicates?
No, as long as each run overwrites its
event_datepartition instead of appending, because the re-run replaces whatever the failed attempt left behind. The same property makes a backfill safe, and it is the first thing to verify on a job someone else wrote. - A phone was offline and its events show up 2 days late. Where do they go?
They land in the raw partition for the day they happened, and the daily run rebuilds a trailing window of recent days so the curated tables pick them up. Mobile clients buffer while offline, so on an engagement feed late data is the normal case.
- The app team adds a field to story view events. What breaks?
Nothing at landing, since raw stores each event as it arrived, and the transform picks the field up whenever a team asks for it. A removed or retyped field is the dangerous change, and the null-rate checks in the quality gate are where it shows up before publish.