Skip to content
About
Main content

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.

Try each one before you open the answer.
1Design the monitoring for a daily revenue pipeline that must be correct by 09:00. Management asks why you need more than the green dashboards you already have.Show the answer

Why green is not enough

Job success and CPU say nothing about the data itself.

Observe the data

on , alerting when it exceeds a threshold derived from the ; a volume band compared with the same weekday; lag per , with its trend; and , with the largest partition under 5 times the median.

Observe absence

A declared expectation for each feed, with an owner, and canaries at source and sink to prove the path is alive.

Alert on symptoms

Page only when the table is stale or too small at 08:00, or ingestion has stopped, with a burn-rate rule for the SLO "ready by 09:00 on 99% of business days". Causes go on dashboards.

Publish safely

Write–audit–publish, auditing against the payment provider's total.

Trade-offs

More checks mean more maintenance, and every expectation can go stale. Start with , volume and write–audit–publish.

Read moreObservation is a second machineCorrect per arrivalSLOs and burn rateWrite-audit-publish

2The metrics server runs out of memory every Monday after a release. How do you diagnose and prevent it?Show the answer

Diagnose

Suspect . Count per metric and compare with last week, looking for a new label with unbounded values: a user ID, a request ID, or a URL path containing an ID.

Short term

Drop the label at the .

Prevent

A series limit per metric, enforced in the pipeline (drop and count violations, never apply to the application); a code-review rule that labels be bounded and enumerable; and a change-event marker for each release, so correlation is quick. Move identities into structured logs or traces, linked by .

Trade-off

Per-user aggregates leave the metrics; per-user questions become log queries, which cost more and are sampled.

Read moreCardinality is the cost modelLossy by designChange events

3Pages per week grew from 10 to 150 as the company grew. The team asks for a better anomaly detector. Is that the right fix?Show the answer

No

It is a problem of and attention: alert volume grows with the system, and attention does not. A better detector cuts false positives by some factor, but when real incidents are 10⁻³ of checks, even a 0.1% false-positive rate gives .

Fix the structure

  1. Page only on symptoms consumers can see.
  2. Multi-window burn-rate alerts, which say how much budget is spent before they fire.
  3. Group alerts by dependency using , so one root cause pages once (this depends on correct lineage).
  4. Route alerts by ownership.
  5. Test severity against action: "look at it tomorrow" is a ticket, not a page.

Watch out

Anomaly models can learn a broken state as normal, and move the work into maintaining models. Measure pages per week and the share that needed action, but do not make "fewer pages" a target on its own, or people will suppress real alerts.

Read moreAlerting is a base-rate problemAnomaly detection and fatigue

4Ingestion consumers show 30,000 records of lag, which the team considers fine. At 03:00 the dashboard is hours behind. What happened, and what should you monitor instead?Show the answer

Diagnose

lag is a level, and a sum. The cause may be one stuck partition (the maximum is what hurts), or producers outpacing consumers (the trend). , which is infinite once consumers are no faster than producers.

Monitor instead

Lag in time (the age of the oldest unconsumed record) per partition; the trend of lag; the largest partition against the median; and the freshness of the output table, which is the actual symptom.

Alert

Page on freshness, or on time lag rising fast enough to breach the SLO within some horizon ("will breach in 40 minutes at the current slope").

Trade-off

Series per partition cost partitions × consumer groups; keep that number bounded and enumerable.

Read moreConsumer lagPer partition, not as a sum

5Design tracing and sampling for a platform producing 50,000 spans per second, with traces lasting 10 seconds on average and a memory budget of 200 MB per collector.Show the answer

Estimate

must buffer span rate × trace duration = in flight. At about 1 KB per span, that is about 500 MB, so one collector is not enough, and every span of a trace must reach the same collector (route by trace ID). At 200 MB each you need at least 3 collectors, more with headroom.

Alternative

Head-sample the bulk at, say, 10% (cheap and stateless), and add tail rules only for high-value traffic such as errors and slow requests; or rely on exemplars, so every bucket still carries an example.

Trade-offs

Head sampling drops rare errors; tail sampling costs memory and a coordination layer, which belongs to the system and must drop when full rather than stall the application.

For data pipelines

Tracing every record does not fit; use sampled records and lineage at the level of .

Read moreSampling: before or afterExemplarsWhere tracing breaks down for data pipelines

6A team is deploying a rewrite of the job behind a critical table. Last time, a bad deploy corrupted downstream reports. Design the release process.Show the answer

Process

  1. A shadow run for 2–3 nights on identical input, comparing aggregates and distributions within a tolerance, not individual rows, because of non-determinism. Costs double compute for that window.
  2. Write–audit–publish for every publication: write to staging, audit (a band for row count, null rates, totals against an independent source), and publish with an atomic pointer swap, which needs atomic metadata commits from the table format.
  3. Keep the previous version as a blue-green copy for N days, for instant rollback, at double the storage for that table.
  4. Emit a at deploy time on every freshness and volume chart.

And for what audits miss

Shorten the time to detect it: .

Failure modes

Audits too weak, proving only that the output looks plausible; a shadow period that misses month-end; and consumers reading the staging table by mistake, so restrict its permissions.

Read moreShadow pipelinesWrite-audit-publishBlue-green tables

7Design the observability of the observability system itself. Where does alerting run, and what happens when the telemetry collector is overloaded?Show the answer

It is a data pipeline

Telemetry is ingested, partitioned, indexed, compacted, tiered and expired like any other data.

Two rules

It must be lossy by design: when saturated, drop telemetry and count the drops; never apply backpressure to the application. And the alerting path must not share a with what it watches.

Design

A small external critical path (alert evaluation, paging, and a that pages when the heartbeat stops for, say, 5 minutes) and a large shared path for analysis. Budget about 5–15% of infrastructure cost, depending on logging discipline.

Trade-offs

Two systems mean two operational burdens and context split during incidents; the external path needs its own heartbeat check; and where you draw the line between external and shared decides which incidents remain invisible.

Read moreThe telemetry pipeline is a data systemLossy by designSeparate failure domains