Module O-10·30 min read

A repeatable 45-minute framework, plus three worked designs — chat with presence, ride-hailing, and video streaming — with the trade-offs an interviewer actually probes.

JJS
Written by Jatin Jain Saraf · Senior Software Engineer

Module O-10 — Capstone: The System Design Interview

What this module covers: What a system design interview actually assesses, which is not whether you know an answer. A repeatable 45-minute framework with time boxes, and the single highest-leverage move in it — stating the non-functional priority out loud in minute four, because every subsequent decision follows from it. A compressed toolkit that maps a problem shape to the mechanism this course built for it. Then three worked designs, each chosen to exercise a different half of the curriculum: chat with presence, where the fan-out answer inverts the one from Module A-14 and for a nameable reason; ride-hailing, where the dominant write load is disposable data and the matching problem is a distributed lock you should design away; and video streaming, where the design is a bandwidth and cost problem rather than a request-rate problem. Each with the trade-offs an interviewer probes. And a closing pass over the five through-lines that have run the length of the course.


What Is Actually Being Assessed

Not recall of a canonical design. The signals an experienced interviewer is reading:

SignalWhat it looks like
Scopingturning an ambiguous prompt into three or four concrete requirements
Arithmeticdoing the numbers, roughly, out loud, and letting them decide the design
Decisions with costs"sharding, and the cost is cross-shard queries and a resharding project"
Prioritisationnaming what you are optimising for before choosing mechanisms
Communicationnarrating reasoning so the interviewer can follow and intervene
Adaptabilitychanging your design when new information arrives, without defensiveness

And the failure modes, which are more consistent than the successes:

  • Jumping to a solution in minute one, before the requirements exist.
  • Naming technologies instead of trade-offs. "Kafka, Cassandra, Redis" is not a design; the question is always what each buys and what it costs.
  • Never doing the arithmetic, so every decision is untethered — this is the most common and most damaging omission.
  • Over-designing. Multi-region active-active for a product with 40,000 users is a wrong answer, and confidently proposing it demonstrates the opposite of judgement.
  • Silence while thinking. The interviewer is assessing reasoning they cannot see.
  • Defending a choice after being shown a problem with it.

Analogy: a structural engineer asked how they would bridge a river. The answer is not "a suspension bridge" — it is "how wide, what load, what soil, what budget, how long must it last, and is a ferry acceptable?" Then a rough calculation, then a proposal with its costs stated, then a willingness to change span type when told the riverbed is silt. Somebody who names a bridge type in the first sentence has told you they do not know what determines the choice.


The 45-Minute Framework

TimePhaseOutput
0–5Requirements and scope3–5 functional requirements, the NFR priority, explicit exclusions
5–10EstimationQPS average and peak, read:write ratio, storage/year, bandwidth
10–15API and data modela few endpoints; core entities; the ID and partition-key choice
15–30High-level designthe boxes, then one write path and one read path end to end
30–40Deep divethe bottleneck — theirs or one you offer
40–45Failure modes and next stepswhat breaks, what you would measure, what you deferred

0–5: Scope, and ask what to optimise for. Pick three to five functional requirements and say what you are not building. Then the move that matters most:

State the non-functional priority explicitly. "This is a payment system, so correctness outranks availability: if the two conflict, we fail the request." Or "this is a feed, so availability and latency outrank consistency: a thirty-second-stale feed is fine, a slow one is not."

That single sentence determines the ledger design, the conflict-resolution strategy, the replication mode, the caching aggressiveness and the failure behaviour. Modules P-24 and A-14 were deliberately built as mirror images to demonstrate it. Say it in minute four and the remaining forty minutes are consistent; skip it and you will make contradictory choices and be caught.

5–10: Do the arithmetic, roughly and aloud. DAU, actions per user per day, seconds in a day (~100,000 is close enough to 86,400), peak as 2–5× average. Storage per record times records per day times 365. Round aggressively and state assumptions — precision is not the point; the point is that the numbers should decide things. "1,200 writes per second with 200 followers each is 240,000 timeline writes per second, so pure write-time fan-out needs a plan" is the arithmetic doing its job.

10–15: The two choices that matter in the data model are the ID scheme (time-ordered for locality and pagination — Module P-3) and the partition key (which must align with the access pattern — Module P-6). Everything else can be sketched.

15–30: Walk the paths. Draw the components, then trace one write and one read through them, end to end, naming what happens at each hop. Most of the interview's signal is here, because tracing a path exposes whether the design is coherent.

30–40: Have a bottleneck ready. If the interviewer does not choose, offer the most interesting one — usually the hot key, the fan-out, or the write amplification. Volunteering the hard part is a stronger signal than being led to it.

40–45: Do not skip this. Failure modes, what you would measure (Module O-1's per-mechanism metrics), and what you deliberately deferred. This is where seniority is visible, and candidates routinely run out of time because they over-invested in the diagram.

Meta-rules throughout: narrate; state every trade-off with its cost named; ask before assuming; and start with the simplest design that meets the stated requirement — one region, one database, a cache — escalating only when a number you computed forces it. Reaching for the complex design without a number to justify it is the over-design failure.


The Toolkit: Problem Shape → Mechanism

The interview is largely a recall test over the course. Compressed:

ShapeReach forCost to name
Read-heavycache, CDN, read replicas, denormalise, precompute (F-12, P-5, P-22)staleness, invalidation
Write-heavyappend-only/LSM, shard, batch, queue (P-2, P-6, P-14)compaction, cross-shard queries
Fan-outhybrid push/pull (A-14)complexity, two code paths
Hot keyshard the counter, escrow, conflate (P-6, A-9, A-10)more expensive reads, stranded capacity
Cross-service consistencyoutbox + idempotent consumer (A-3, P-16)eventual consistency, operator queue
Orderingpartition by entity key (P-15)no global order
"Exactly once"at-least-once + idempotent receiver (P-16)dedupe window and storage
Slow dependencytimeout, breaker, fallback (A-6, A-7)degraded quality; a fallback to test
Overloadbound the queue, shed, prioritise (A-8)rejected requests
Global userspartition by home region (A-9)cross-partition operations
Search / semanticinverted index; embeddings + rerank (P-20, P-21)a sync problem, and recall to measure
Large payloadsobject storage + pre-signed upload + CDN (A-11)orphan reconciliation
Must not lose itdurable record + lease + bounded retry + DLQ (P-19)operational surface

Worked Design 1 — Chat With Presence

Requirements. 1:1 and group messages; delivery and read receipts; online presence; message history; push notification when offline. Out of scope: voice/video, moderation, search.

The priority statement: messages must not be lost, and per-conversation ordering must hold; presence may be approximate and slightly stale. Note this leans towards correctness — closer to Module P-24 than to Module A-14 — which is going to change the fan-out answer.

Numbers. 100 M DAU × 40 messages/day = 4 B/day ≈ 46,000 writes/s average, ~150,000/s peak. At ~300 bytes per message that is ~1.2 TB/day of message data, so storage is the volume and it must be partitioned and tiered (Modules P-9, O-8).

Design.

text

The key decision, and it inverts Module A-14. For a feed, the answer was to materialise a per-recipient timeline. For chat, the better answer is a shared per-conversation log plus a per-user read cursor:

Sign in to keep reading

The rest of this module is free — sign in with Google to unlock it and track your progress.

Sign in & Register

Discussion

0

Join the discussion

Loading comments...

© 2026 Jatin Jain Saraf (JJS). All rights reserved.