Data pipelines in production · senior
Data quality, contracts and shared metrics
Quality checks run at ingestion, after transforms and before publishing. Contracts stop silent schema changes. One owned definition in a shared layer stops two teams reporting different numbers.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Kinds of checks: freshness, volume, schema, completeness, uniqueness, validity, referential integrity, reconciliation with the source, and anomaly checks against history.
- Where: on ingestion (schema, parse errors to a quarantine table), after transformations (uniqueness, join row counts, business rules) and before publishing (totals against the source, anomaly checks).
- Write-audit-publish: build into a staging table or branch, run checks, then publish by swapping, so users never see unchecked data.
- On failure: blocking checks stop the publish and page the owner, leaving yesterday's data in place. Warning checks publish and notify. Send bad rows to quarantine and fail only above a threshold, for example 0.5%.
- Tools: dbt tests and contracts, Great Expectations, Soda, Deequ for Spark, Delta CHECK and NOT NULL constraints, and expectations in Lakeflow Declarative Pipelines.
- A silent rename: the parser read the old field and defaulted a missing value to 0. A default that hides missing data is the real bug. Add schema checks, null-rate or zero-rate checks and anomaly checks on shares such as discount as a share of revenue.
- A data contract is an agreed schema, meaning, owner, freshness and quality promises for tables or events others use, versioned with a notice period for breaking changes. Enforce with a schema registry, CI checks in the producer repo and dbt model contracts. Do renames as add new then remove old.
- Numbers that change for days: late events are put into their event date and the last days are reprocessed, so recent days grow. Choose the window from measured lateness. Options: label as provisional until D+3, report by arrival date, close at a cutoff and book later events as adjustments, or show both numbers.
- Use the IST date for the business day. A fact that arrives before its dimension row points to the unknown member and is fixed later.
- Two MAU numbers (4.1 crore and 3.6 crore): build a bridge step by step (background-push devices, people with two phones, logged-out devices, web users, test accounts, UTC versus IST month). Both can be right for different questions (devices versus users). Agree the official definition, store it in one semantic or metrics layer, and retire the other query.
The red pen
Common traps: mistake → fix
Mistake: Check nulls only
Fix: add uniqueness, ranges, freshness, volume and reconciliation.
Mistake: The app team should have told us
Fix: add a contract and checks so you detect it anyway.
Mistake: Freeze the number by dropping late events
Fix: late data is real; define provisional and final.
Easy to hard
Questions interviewers ask, easy to hard
- Design data-quality checks for the pipeline behind the revenue tables.
- An upstream team renamed a column and discounts were zero for six days. What now and what changes?
- Business users say yesterday's order count keeps changing for three days. What is going on?
- Two teams report different monthly active users. How do you settle it?
- What is write-audit-publish?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.