System Design Interview Tutorial · Chapter 1

The system design interview

A system design interview gives you an open-ended prompt ("design a webhook delivery system") and about an hour to design it out loud. There is no single right answer. You are graded on your reasoning, not on the final diagram. Two candidates can draw the same boxes and get opposite verdicts: the one who explained why each choice was made and what breaks gets the hire.

What the interviewer scores

They score What they listen for Red flag
Clarifying requirements You narrow the scope and write numbers: QPS, data size, latency target Drawing boxes in minute 3
Practical choices Real technology with a reason: "Postgres, because balance updates need transactions" "NoSQL because it scales"
Explicit trade-offs "A or B. I pick A because X; B wins if Y changes" One option, presented as obvious
Depth Schemas, keys, API shapes, partition keys, retry semantics Staying at box-and-arrow level
Failure handling You raise failure modes before being asked Waiting for them to break it
Growth "At 10× the bottleneck moves to Z; here is how it evolves" Building for 1000× on day one
Staying current Outbox, change data capture, cells, backpressure, token streaming Only 2015-era vocabulary

The 60-minute clock

Introductions and your questions at the end take about 10 minutes, which leaves about 50 minutes for the design. Split them into six phases:

Phase Time What you produce
1. Requirements & scope 7 min 3–5 core features, explicit non-goals, non-functional requirements as numbers
2. Estimation 3 min Average and peak QPS, storage, bandwidth, and the one number that drives the design
3. API & data model 5 min 3–5 endpoints with request and response; core entities and keys
4. High-level architecture & Data flow 10 min The simplest design that works, traced end to end
5. Deep dives 20 min 2–3 hard parts: the bottleneck, consistency, failure handling
6. Failures, ops & evolution 5 min A failure sweep, observability, what changes at 10×

Narrate your checkpoints: "I have the requirements; three minutes on estimates, then the API." Interviewers score pacing, and saying it out loud invites them to redirect you early.

The six phases

1. Requirements & scope

The most underrated phase. Ask questions that change the design, not filler:

Write the non-functional requirements as numbers, for example p99 read < 200ms, 99.95% availability, durable writes, feeds may be eventually consistent. Every later decision should point back to this list.

2. Estimation

Estimation is not arithmetic theater. It answers one question: which resource saturates first, and at what scale? That resource is your bottleneck, and it shapes the architecture. Round to powers of 10 and end every number with "so the design needs…".

The chain is always the same: users → daily active users → actions per day → average QPS → peak QPS → read/write split, then storage, bandwidth and concurrency from there.

Quantity Rule of thumb
Average QPS daily actions ÷ 10⁵ (a day is about 86,400 seconds)
Peak QPS 2–3× average for daily cycles; 5–10× for launches and events
Storage per year writes/day × object size × 365 × 3 replicas
Cache about 20% of the daily hot read set, and it must fit in RAM
Servers peak QPS ÷ per-node QPS ÷ 0.5–0.7 target utilization, plus spares
Concurrency Little's Law: L = λ × W (in-flight requests = arrival rate × time in system)

Little's Law is the most underused formula in interviews. 10K requests/s × 50ms is 500 requests in flight, which a few servers handle. 1K LLM requests/s × 30s of streaming is 30K concurrent streams, where connections, GPU slots and memory become the problem, not QPS.

Say what the numbers mean: "100M daily users × 20 writes is about 2K writes/s on average, 10K at peak, so one Postgres primary is enough and we don't need write sharding yet. Reads are 100× that, so caching is the real problem."

3. API & data model

4. High-level architecture & Data flow

5. Deep dives

This is where hire or no-hire is decided. Pick the 2–3 hardest parts yourself ("The interesting problems are X and Y. Shall I start with X?") and work through each with the same shape:

Problem → 2–3 options → trade-off → pick → what would change my mind

For example, feed fan-out: push on write gives O(1) reads but write storms for celebrities; pull on read makes writes cheap and reads expensive. Pick a hybrid: push for most users, pull for accounts with more than 100K followers. Switch to pull if writes came to dominate.

Get concrete: schemas, keys, retry semantics, numbers. When the interviewer asks "what about…?", they are steering you. Follow the hint; don't defend.

6. Failures, ops & evolution

Walk your diagram box by box and ask: if this dies, slows down or returns garbage, what happens?

Name the degraded mode: "If ranking is down, serve the feed in time order." Then spend a minute on operations (rate, errors and latency per service; SLO alerts on p99 and error rate; tracing across queues) and on what changes at 10×.

Building blocks

Most prompts recombine the same dozen sub-problems. Know the standard tools and the trade-off you will be asked about:

Sub-problem Standard tools Trade-off to explain
Read scaling Cache-aside, CDN, read replicas Staleness vs load; stampedes (coalescing, jittered TTLs)
Write scaling Hash or range sharding, batching, write-behind Hot keys, cross-shard queries, resharding cost
Async work Queue (SQS, Kafka), workers, dead-letter queue At-least-once delivery needs idempotent consumers; ordering only per partition
Exactly-once effects Idempotency keys, dedupe table, transactional outbox Storage and lookup cost vs correctness
Cross-service consistency Outbox + change data capture, sagas, rarely 2PC Sagas are eventual with compensation; 2PC blocks
Rate limiting Token bucket in Redis, sliding window, local + global Accuracy vs latency; fail open or closed when Redis is down
Real-time delivery WebSocket or SSE, pub/sub, connection gateway Stateful connections complicate deploys and rebalancing
Scheduling, long jobs Durable job table with leases and heartbeats Short leases duplicate work; long leases slow recovery
Search Inverted index, vector (ANN) index Freshness vs write cost; recall vs latency
Multi-region Active-passive, active-active, geo-routing Consistency vs latency vs cost
Large files Object storage, presigned URLs, metadata database Never stream bytes through app servers

When the system serves AI models

Many prompts now involve LLMs, and their physics are unusual. Raising these unprompted is a strong signal:

How to communicate

  1. Narrate intent: "I'll make an assumption here and flag it."
  2. Use one trade-off sentence: "I choose X over Y because of requirement N; if that changed, I'd switch to Y."
  3. Zoom on demand: go from box → schema → index → partition key → failure behavior in two minutes.
  4. Handle unknowns honestly: "I haven't run X in production, but I'd expect Y because Z, and I'd confirm it with a load test."
  5. Keep the board tidy: requirements on the left, diagram in the center, open questions and risks on the right.
  6. Avoid the classic mistakes: unexplained buzzword boxes, Google-scale designs for 10K users, long silences, skipping the API, never mentioning a failure.

How to prepare

A two-week plan:

All chapters