Scenarios
Longer problems, like those in senior system design interviews. A strong answer estimates with numbers first, names the mechanism, then recommends a fix and says what it costs.
1Ten teams read your event topic. You must rename a field and change an enum. How do you plan it?Show the answer
Constraints
You cannot list every consumer or deploy them all at once, and with fields identified by name a rename is a drop plus an add.
Find the readers first
Registry subject consumers, mining of query logs, and a contract with a registered list of consumers. Unknown consumers set the minimum notice period.
The rename
Expand and contract: add weight_kg (optional, with a default), write both fields for at least one full retention window, backfill, notify teams and track each one's migration, verify zero reads of weight for 30 days, then drop it.
The enum
First make sure every consumer has an explicit branch for unknown values, then add the value. Or move the statuses into a reference table.
Guard and trade-offs
Add a schema-diff gate in CI and transitive compatibility checking. The process takes months, the schema temporarily has duplicate fields, and without read telemetry the final drop never happens: treat telemetry as a prerequisite, not a bonus.
Read moreStructure becomes a variableExpand and contractEnum evolution
2Design the ingestion layer for a multi-tenant platform where each customer sends different fields. Leadership wants no deployments to onboard a customer, but also trustworthy dashboards.Show the answer
Design
A fixed, required core (tenant, event type, timestamp, key, schema version), validated on write, plus a variant column for each tenant's own fields, with frequently used paths shredded into typed sub-columns.
Keep the escape hatch an escape hatch
A promotion rule: for example, a field in over 60% of one tenant's records for 14 days becomes a declared column. Freeze each tenant's inferred payload schema and alert on drift, rather than widening it automatically.
Costs
Variant columns compress and prune less well, and every variant path a dashboard reads is a promise bound late, unless promoted. Dashboards should read only the core and promoted columns.
Failure mode
Without a promotion rule, within a year most data lives in the variant, and you have rebuilt schema-on-read.
Read moreA per-field decisionVariant columnsThe useful inversion
3A pipeline is green, yet revenue has been 40% low for three days. Diagnose and prevent it.Show the answer
Hypotheses
- A producer change made records invalid, and a dead-letter queue is silently absorbing them.
- Permissive parsing is coercing values to null.
- A default applied by readers changed.
Check
Dead-letter queue depth and growth, violation counters, the null rate per column over time, and row counts against the source.
Likely cause
An unwatched dead-letter queue with no rate threshold.
Prevent
A violation counter; a threshold over a window (for example, more than 2% of the last 1,000 records halts the pipeline); freshness and volume expectations in the contract; and an owner who gets paged. 40% bad is a schema change, and it needs a stop, not a queue.
Read moreDead-letter versus permissive parsingThe rate thresholdContracts
4The schema registry is down. What should happen to producers? Design the system for availability.Show the answer
The choice
Fail closed (ingestion stops, data stays valid) or fail open with a cache (ingestion continues, schemas unvalidated).
Design
Keep the registry off the data path: producers cache schema IDs and schemas, consumers cache what they need to decode, and only registering a new version needs the registry. Registration then happens in CI and deployment, a few times a month, so an outage blocks releases but not ingestion. For a genuinely new schema during an outage, fail closed for that producer only.
Numbers
A registry that is 99.9% available is down about 8.8 hours a year; if every message needed it, ingestion would inherit all of that.
Read moreAvailability: the neglected part
5You need to change a 5 TB table holding three years of data from daily to hourly partitions. Is it worth it, and how?Show the answer
Check the preconditions
The partition value must be a declared function of a column, such as day(ts), recorded in metadata per file, not encoded in file paths. If so, add hour(ts) for new files; old files stay daily.
What it means for queries
Queries spanning the boundary prune well on new files, but read 24 times more per hour of range on old ones.
Decide from the query logs
If most queries hit the last 90 days, rewrite only that range, as a bounded job. If queries spread across all three years, a full 5 TB rewrite may be justified, but it changes file identity and invalidates caches.
If partitioning is in the paths
The change is a rewrite plus a contract change with every reader of those paths. Either way, performance differing by era is permanent until old files are rewritten.
6Compare data contracts with a schema registry. When is each sufficient?Show the answer
A registry
Machine-checked structural compatibility, turning N × M agreements into N + M. Enough when producer and consumers are one team and changes are additive.
Contracts
They add what a registry cannot: semantic types and units, an owner, a registered list of consumers, freshness and volume expectations, and a notice period. Needed when teams differ, because the main risks are changes of meaning (cents to dollars) and consumers nobody knows about.
The catch
Contracts work only if breaking them costs the producer; without that incentive, they get bypassed.
Recommend
A registry plus a CI diff plus a contract with a consumer list, for any table read by other teams; and tie producers' on-call or service-level penalties to breaking their consumers.
Read moreWhy a registry existsContractsThe honest assessment
7A team asks to drop 14 unused columns and change price from integer to decimal in a three-year-old table. Walk through your answer.Show the answer
Dropping
Requires proof the columns are unused: column-level lineage combined with usage telemetry, for example no reads in 90 days. With columns identified by ID, dropping is a metadata change and old files stay readable.
Integer to decimal
It is not a safe widening: the scale rescales values and precision can narrow. Do it as expand and contract, with a new column and a backfill, not in place.
Warn
A schema-only migration keeps every old version alive, so transitive compatibility must continue to hold.
Without telemetry
Do not drop: the contract step cannot be decided, and the first investment is observability of reads.
Read moreThe hard step is the last oneLineage and usageType promotion versus coercion
8Your team proposes automatic type coercion in the ingestion layer, to avoid pipeline failures. Argue for or against.Show the answer
Against, as a default
Coercion turns a type error into a value, and values have no error channel, so the failure moves into the data, where it looks normal: a coerced null is indistinguishable from a genuinely missing value. And it is irreversible, since the original is gone once converted.
If completeness matters
Allow coercion only for provably safe promotions (int32 to int64); reject everything else to a dead-letter queue that someone watches, with a violation counter and a rate threshold.
The test
Can each consumer detect degraded data on its own? If not, rejection is mandatory.
Read moreType promotion versus coercionThe decision variableWhat schema evolution forbids