Skip to the notes
JSGroundwork
JSGroundwork handwritten · web dev
✎Playground→⌘Problems↻Review🔥Progress

Chapters

24 chapters
⌕
Beginner7›
B1The mental modelB2Client-server basicsB3Vertical vs horizontalB4Databases in designB5Caching fundamentalsB6APIs & communicationB7Walkthrough: URL shortener
Intermediate9›
I1Load balancing in depthI2CDNsI3Message queues & asyncI4Consistency modelsI5Rate limiting & throttlingI6Designing for availabilityI7Storage systemsI8Search systemsI9Walkthrough: feed/chat
Advanced8›
A1CAP theorem in depthA2Sharding at scaleA3Distributed consensusA4Fault toleranceA5Observability at scaleA6Capacity estimationA7Case studiesA8Tradeoff thinking
/ search[ ] chaptert top

System Design levels

1Beginner2Intermediate3Advanced

Ready to read

JSJavaScript⑂Git◎Interview prepΣDSA in JSSDSystem Design
More topics15›
</>HTML{ }CSS⚛ReactNNext.jsNeNest.jsTSTypeScriptNoNode.js🐳DockerDBSQL & Databases✓Testing🔒Web Security☁Cloud & DevOps◈GraphQL◆Redis☸Kubernetes
100%
B1

What system design interviews test

There is no answer key — the interviewer is scoring how you got there, not where you landed.

The interviewer is scoring a process, not an answer

A coding interview has a correct answer: the tests pass or they don't. A system design interview does not. Two candidates can draw the same boxes on the same whiteboard and receive opposite recommendations, because the artifact being evaluated is not the diagram — it's the sequence of decisions that produced it. The interviewer is filling in a rubric with rows like "gathered requirements before designing" and "articulated a tradeoff without being prompted." Your drawing is only evidence.

This is why strong engineers with real production experience sometimes fail the loop. They design the way they design at work — quietly, in their head, then present a conclusion. In a 45-minute interview an unspoken thought is a thought that did not happen.

What the rubric row saysWeak signalSenior / staff signal
Requirement gathering Starts drawing from the one-line prompt Spends 5-8 minutes turning a vague prompt into a bounded problem, and writes the scope down where both of you can see it
Structured thinking Jumps between topics as they occur; the board becomes a mess Announces the plan ("requirements, then scale math, then a high-level design, then we pick something to go deep on") and visibly follows it
Explicit tradeoffs Names a technology ("I'd use Kafka") Names the alternative they rejected and the property that decided it ("a queue over direct calls, because I want the write path to survive the consumer being down — cost is end-to-end latency and an at-least-once contract")
Calibration to scale Shards a database for a 500-employee internal tool Sizes the solution to the stated load and says out loud what would have to change to justify more
Depth Every component gets one sentence Can go three levels down on any box they drew — data model, failure behaviour, and what happens at 10x
Knowing what you don't know Bluffs a confident wrong number "I don't know Spanner's exact commit latency; I know it's bounded by the TrueTime uncertainty window, so single-digit to low tens of milliseconds. I'd design assuming 10 ms and verify."
Collaboration Treats interviewer questions as attacks to deflect Treats them as new requirements, updates the design, and says what the change costs

The last row is the one candidates underrate most. The interviewer is simulating a design review with a colleague. If disagreeing with you is unpleasant, that is a hire-signal problem no amount of correct architecture fixes.

The 45-minute arc

Almost every system design round at a large company follows the same shape, whether or not the interviewer states it. Knowing the shape lets you budget time instead of discovering at minute 40 that you never discussed failure.

the classic failure: drawing boxes at minute 2 clarify requirements estimate scale high-level design deep dive (they choose) bottlenecks and failure 0-8 min 8-13 min 13-23 min 23-38 min 38-45 min The green phase is where most of the score lives — depth on one component beats a shallow tour of eight. The yellow phase is where most candidates lose the interview by skipping it.
Budget the clock out loud. Announcing "I'll spend about five minutes on requirements" is itself a scored signal — it tells the interviewer you have run this meeting before.
PhaseWhat you produceThe failure mode
Clarify (0-8) A written list of in-scope features, out-of-scope features, and the non-functional targets you'll design against Accepting the prompt at face value and designing something nobody asked for
Estimate (8-13) QPS (average and peak), storage per year, and one derived number that constrains the design Arithmetic theatre — computing numbers you never refer to again
High-level (13-23) 6-10 boxes, the data flow for the one or two critical paths, and the data model Twenty boxes with no data model; the model is what proves you understand the problem
Deep dive (23-38) One component taken to implementation-level detail, chosen by the interviewer Staying at the same altitude you were at in the high-level phase
Failure (38-45) What breaks first under 10x, what happens when each dependency dies, how you'd detect it Never getting here because the earlier phases ran long
Say it like this → "Before I draw anything: I want to spend a few minutes on requirements and rough numbers, then sketch a high-level design, then go deep wherever you're most interested. Does that work, or is there a specific area you'd like me to prioritise?"

Functional vs non-functional, and why only one of them shapes the design

Functional requirements are what the system does: users can shorten a URL, followers see a post, a rider is matched to a driver. They determine your API surface and your data model. Non-functional requirements are the properties the system must hold while doing it: latency, availability, consistency, durability, scale, cost. They determine the architecture.

This distinction earns its keep because functional requirements are usually easy and non-functional ones are where the interesting decisions live. "Users can post a tweet" is a row insert. "A tweet is visible to 100 million followers within two seconds" is the entire design.

Non-functional requirementAsk it asWhat the answer changes
Scale "How many daily actives, and what's the read-to-write ratio?" Whether you need caching, replicas, sharding — or none of the above
Latency "What's the p99 target for the read path?" Cache placement, whether cross-region calls are allowed on the critical path, sync vs async work
Consistency "If a user updates their profile, must they see it on the next read? Must their friends?" Read-your-writes routing, whether replicas can serve reads, single-leader vs multi-leader
Availability "Is it acceptable to be read-only during a regional outage?" Multi-region topology, failover strategy, and how much complexity is justified
Durability "Is losing the last second of writes a bug or a catastrophe?" Synchronous vs asynchronous replication, write-ahead log fsync policy, queue acknowledgement semantics
Cost "Are we optimising for engineer time or infrastructure spend?" Managed services vs self-hosted; whether "just add a bigger box" is allowed
⚠ Asking questions is not the same as gathering requirements Candidates learn that they should "ask clarifying questions" and then fire off eight of them without using any of the answers. The signal comes from the loop: ask, hear the number, say what it implies, write it down. "10 million DAU with a 100-to-1 read ratio — so this is a read-heavy system and I'll be spending my design effort on the read path" is worth more than the next five questions.

Estimation you can do in your head, out loud

The point of the scale math is not the number, it's the decision the number unlocks. You are looking for an order of magnitude that tells you which of three or four architectures is appropriate. Round aggressively; nobody wants to watch you long-divide.

The one conversion to memorise A day is 86,400 seconds — call it 100,000. So 1 million requests per day ≈ 12 per second, and 1 billion per day ≈ 12,000 per second. Almost every QPS estimate you will ever do in an interview is this ratio scaled up or down, then multiplied by 2-3 for peak.

A worked pass, in the amount of detail you'd actually speak: 100 million daily actives, each reading their feed 10 times a day, is 1 billion reads a day, so about 12,000 reads per second average and call it 30,000 at peak. Writes at one post per user per day is 100 million a day, roughly 1,200 per second — a 10-to-1 read/write ratio. At 1 KB per post that's 100 GB of new post data per day, so 36 TB a year before replication, media, or indexes.

Now use it. 30,000 reads per second will not come off a single relational primary, so reads must be served from cache or replicas. 1,200 writes per second will fit on one well-tuned Postgres box, which means sharding the write path is not yet justified and saying so is a senior signal. 36 TB a year means the hot dataset and the cold archive should not live in the same place. Three architectural decisions from four multiplications.

AnchorValue to quote
Seconds in a day~100,000 (86,400)
1M requests/day~12 QPS
Peak-to-average traffic ratio2-3x for consumer apps; 5-10x for event-driven spikes
A tweet-sized text record~200 bytes to 1 KB with metadata
A compressed photo~200 KB - 1 MB; a minute of 1080p video ~ 50 MB
One commodity app serverThousands of RPS for simple JSON, hundreds if it does real work per request
One relational primary~5,000-20,000 simple reads/sec, ~1,000-10,000 writes/sec
One cache node~100,000 ops/sec, sub-millisecond

These are deliberately wide ranges. Quoting a range with the caveat "depends on row size and whether it's index-only" reads as experience; quoting "Postgres does 8,342 QPS" reads as memorised trivia and invites a follow-up you can't answer.

Why "it depends" is the right answer — and why it's usually said wrong

"It depends" alone is the single most common way to sound senior and score as junior. It is a correct observation that transfers the work back to the interviewer. The complete form has three parts, and takes about fifteen seconds:

  • It depends on X — name the specific variable, not "the use case"
  • Here's how I'd decide — the threshold or test that resolves X
  • Absent that information, here's my default and why — commit to something
Say it like this → "Whether I cache the feed depends on the read-to-write ratio and how tolerant we are of stale data. If reads outnumber writes by more than about 10 to 1 and a few seconds of staleness is fine, caching is clearly worth it. You said 100 to 1 and this is a social feed, so I'm going to cache, with a short TTL plus invalidation on write."

The third part is what separates the two grades. A staff-level candidate is someone a team can be pointed at an ambiguous problem with, and who returns with a decision. Endless conditionality is the opposite of that.

"design a URL shortener" 1k links/day, internal tool one table, one app server, an index on the short code 100M links/day, global reads key-generation service, cache, CDN, multi-region replicas
The same prompt has two defensible answers that share almost no components. This is why the scale question comes before the drawing, not after it.

The deep dive: they pick the component, you supply three levels

Somewhere around minute 23 the interviewer will point at a box and ask you to expand it. This is not random — they are steering toward the part of the problem they consider interesting, and toward the depth signal they still need. Whatever they pick, the expansion has the same three levels:

  • Mechanism — what data structure or algorithm is inside the box, and the concrete data model (table columns, key format, index)
  • Behaviour under load — what the hot path costs, where the contention is, what happens at 10x traffic
  • Behaviour under failure — what happens when this box dies mid-request, when it's slow rather than dead, and how a client experiences that

A useful discipline while sketching: don't draw a box you can't take to level three. If you write "recommendation service" on the board and have no model for what's inside it, you have handed the interviewer a place to probe where you will have nothing. Either be ready to open it, or name it explicitly as out of scope: "there's a ranking service here; I'll treat it as a black box that returns an ordered list of IDs unless you want to go into it."

⚠ The slow-dependency question catches almost everyone Candidates prepare for "what if the database goes down" and freeze on "what if it's just slow." Slow is worse: connections pile up, thread pools saturate, and a single degraded dependency takes the whole service down through queueing. The expected vocabulary is timeouts, bounded retries with jitter, circuit breakers, bulkheads, and load shedding. Have one sentence ready on each.

The failure modes that actually end interviews

Failure modeWhat it looks likeThe fix
Drawing at minute 2 The prompt is 12 words and there are already six boxes on the board Force the requirements phase; write scope in a corner of the board and refer back to it
Designing for a billion when told a thousand Kafka, sharding, and a service mesh for an internal admin tool Match the design to the stated scale, then name the trigger that would change it
Silence Thirty seconds of quiet thinking; the interviewer can't score what they can't hear Narrate the search, not just the conclusion: "I'm weighing whether the fan-out happens on write or on read..."
Buzzword placement Naming a technology without a property to justify it Always pair the noun with the property: not "Redis", but "an in-memory store because I need sub-millisecond lookups on a small hot set"
Breadth as avoidance Adding new components whenever a question gets hard Depth is the scored axis after minute 23; go down, not sideways
Defending instead of updating Treating "what if writes are 100x higher?" as a criticism Treat every question as a new requirement: "then my single primary is out — here's what changes"
Bluffing Inventing a mechanism for a system you've only read the name of Say what you do know, name the boundary, reason from principles from there — this scores well, and getting caught bluffing is often terminal

Notice that only two of these are about knowledge. The rest are about conduct in a room. This is the actual reason system design is the biggest differentiator at senior and staff levels: it is the only round that measures how you behave when the problem is underspecified and someone is disagreeing with you.

Recognizing it in an unseen problem

  • The prompt is one sentence and deliberately ambiguous ("design Twitter") — that ambiguity is the first thing being tested, not an oversight to work around
  • If the interviewer volunteers a number ("about a thousand internal users"), it is a constraint they will hold you to; designing above it reads as poor judgement, not ambition
  • When they ask "why?" they are almost never disagreeing — they are giving you a scoring opportunity to state the tradeoff you skipped
  • When they say "let's say traffic grows 100x", they have moved to the bottlenecks phase; stop adding features and start naming what breaks first
  • If you have drawn a box you cannot open to three levels of detail, either open it now or declare it out of scope before they ask
  • If you find yourself saying "it depends" without immediately naming the variable and your default, you have handed back the question — finish the sentence
↑back toThe cover↑ CovernextClient-server basics→