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

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

Raw events land untouched, a daily Spark job rebuilds the curated tables, and the quality gate sits between the transform and the publish. The orchestrator schedules the run and pages on-call when it fails.
  • 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_date partition and the table arrives with full history, while the ingest stays untouched.
A table requested months after the events arrived
-- 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