The System Design Interview

A repeatable structure that keeps you calm, shows your reasoning, and works on any prompt.

The design interview in 30 seconds

  • What's graded: how you think — questions, trade-offs, adapting — not a memorized architecture.
  • Move 1 — Clarify: pin down functional requirements, non-functional targets, and what's out of scope.
  • Move 2 — Estimate: back-of-envelope the QPS, read/write ratio, and data size to find the order of magnitude.
  • Move 3 — High-level: sketch the request path end to end before diving into any one corner.
  • Move 4 — Deep dive: go deep on the real bottleneck with concrete numbers (TTLs, shard keys, replication lag).
  • Move 5 — Trade-offs: name what you optimized for, what you gave up, and the next bottleneck — out loud, the whole time.

A road trip, not a teleport

Imagine a friend asks you to 'drive us somewhere nice'. You wouldn't just floor it in a random direction. You'd ask where roughly they want to go, check how much time and fuel you have, pick a route on the map, then drive — handling the tricky junctions carefully as you reach them. A design interview is that road trip. The prompt ('design Twitter') is vague on purpose, and your job is to turn it into a journey the interviewer can follow turn by turn.

The good news: the route is always the same five moves, whatever the destination. Learn the moves once and you stop memorizing architectures and start deriving them live — which is exactly the skill being tested.

What the interviewer is actually grading

A design interview is deliberately open-ended. The interviewer isn't checking whether you've memorized an architecture — they're watching how you think: do you ask the right questions, reason about trade-offs, and adapt when requirements shift? A structured, narrated approach beats raw knowledge every time, because it shows the signal they're looking for.

Five moves that take you from a vague prompt to a defensible design.

The five moves at a glance

Here's the whole framework on one page. Each move has a rough time budget for a 45-minute interview — not a rule, just a guard against the classic failure of spending 30 minutes clarifying and never reaching a design.

MoveGoalRough time
1. Clarify & scopeAgree what you're building and what you're not~5 min
2. Estimate scaleFind the order of magnitude (QPS, data size)~5 min
3. High-level designSketch the end-to-end request path~10 min
4. Deep diveGo deep on the real bottleneck with numbers~15 min
5. Trade-offs & scaleName what you gave up and the next limit~5 min

Move 1 — Clarify and scope

Never start designing immediately. Pin down the functional requirements (what must it do?) and the non-functional targets (scale, latency, consistency, availability). Agree explicitly on what's out of scope — you can't design everything in 45 minutes, and choosing what to ignore is itself a signal of judgement.

  • Functional: What are the 2–3 core features? (For Twitter: post a tweet, follow users, view a timeline.) Nail these; defer the rest.
  • Scale: How many users? Read-heavy or write-heavy? This single answer reshapes the whole design.
  • Consistency & latency: Must a read see the latest write instantly, or is a few seconds of staleness fine? What's the latency target?
  • Explicitly out of scope: Say what you're not doing (search, ads, DMs) so the interviewer knows it's a choice, not an oversight.

Move 2 — Estimate the scale

Do quick back-of-the-envelope math: requests per second, read/write ratio, data size, and growth. You're not after precision — you're after the order of magnitude that tells you whether one database is fine or you need sharding, whether a cache is worth it, and how much a design must fan out.

Back-of-envelope: a photo-sharing app (pseudo)
# Assume 10M daily active users, 2 photos uploaded/day each
uploads_per_day = 10_000_000 * 2          # 20M writes/day
writes_per_sec  = 20_000_000 / 86_400      # ~230 writes/sec

# Reads dominate: say each user views 50 photos/day
reads_per_day   = 10_000_000 * 50          # 500M reads/day
reads_per_sec   = 500_000_000 / 86_400     # ~5,800 reads/sec

# Read:write ratio ~ 25:1  -> caching + read replicas will pay off

Two numbers unlock most of estimation: there are about 86,400 seconds in a day (round to ~100k for speed), and a daily total divided by that gives you per-second load. Then estimate storage the same way — size per item times items per day times how long you keep them:

Storage estimate: size per item x volume x retention (pseudo)
# Each photo: 2 MB original + ~0.5 MB of thumbnails = ~2.5 MB
per_photo_mb    = 2.5
photos_per_day  = 20_000_000

storage_per_day = per_photo_mb * photos_per_day   # 50,000,000 MB = ~50 TB/day
storage_per_year = storage_per_day * 365          # ~18 PB/year

# 18 PB/year of media -> this MUST go to object storage + a CDN,
# never a traditional database. The estimate decided the architecture.

Move 3 — High-level design

Now sketch the main components and the request path end to end: client → load balancer → service → cache → database, plus any queue for async work. Stay broad first — a clear skeleton the interviewer can follow beats a deep dive into one corner while the overall shape is missing.

  • Draw the happy path first: one request from client to storage and back, naming each box.
  • Separate read and write paths if they differ — they usually do, and the interviewer wants to see you notice.
  • Add async work via a queue for anything slow (thumbnails, fan-out, notifications) so the user-facing path stays fast.
  • Name the data stores and why: object storage for blobs, a cache for hot reads, a relational or NoSQL store for records — justify each in a few words.

Move 4 — Deep dive where it matters

Go deep on the part that's hardest or the part the interviewer probes — usually the bottleneck. This is where your component knowledge earns its keep: pick a caching strategy and pre-empt the stampede, choose a shard key and defend it, decide replication and address the lag. Don't just name a cache — state the read/write ratio, the TTL, and the invalidation plan.

Caching lens

Read path, staleness budget, stampede.

Replication lens

Read scale, lag, failover.

Sharding lens

Shard key, hot keys, resharding.

The tell of a strong deep dive is concrete numbers over vague nouns. Compare the two answers below — both 'use a cache', but only one shows judgement:

Vague (junior)Concrete (senior)
"I'd add a cache.""25:1 read:write, so I'd cache timelines in Redis with a 30s TTL."
"I'd shard the database.""Shard by user_id so a user's data stays together; watch for celebrity hot keys."
"I'd use replicas.""Read replicas for the 5,800 reads/sec; accept ~1s lag, route writes to primary."
"Handle failures.""Circuit-break the thumbnail service; serve the original if it's down."

Move 5 — Trade-offs and scaling

Close by naming what you optimized for and what you gave up, then address the next bottleneck before you're asked. 'This design favors read latency and accepts a few seconds of staleness; the next limit would be write throughput on the primary, which I'd solve by sharding on user ID.' That forward-looking honesty is what separates a senior answer from a junior one.

A worked mini-example: 'Design a URL shortener'

Watch the five moves run on a real prompt, compressed. Notice how each move hands the next one something concrete to work with.

  • 1 — Clarify: Core features: shorten a long URL, redirect a short URL. Out of scope: analytics, custom aliases, expiry. Reads vastly outnumber writes (people click links far more than they create them).
  • 2 — Estimate: Say 100M new URLs/year ≈ 3/sec writes, but 10B redirects/year ≈ ~320/sec reads — a read-heavy ~100:1 ratio. 100M URLs × ~500 bytes ≈ 50 GB — small, fits one database.
  • 3 — High-level: Write path: app generates a short key, stores key→long-URL. Read path: look up the key, return a 301 redirect — fronted by a cache because it's so read-heavy.
  • 4 — Deep dive: How to make keys short and unique? A base-62 encoding of a counter gives 7 chars for 3.5 trillion URLs. Cache hot links in Redis; a cache hit skips the DB entirely, which matters at 100:1 reads.
  • 5 — Trade-offs: Optimized for read latency and simplicity; accepted no analytics. 50 GB needs no sharding yet — the next limit is redirect QPS, solved by scaling the cache and read replicas.
Deep-dive snippet: base-62 keys keep the short URL tiny (pseudo)
# A 7-char base-62 key (a-z, A-Z, 0-9) addresses a huge space:
space = 62 ** 7                     # ~3.5 trillion unique short URLs

def shorten(long_url):
    n = counter.next()              # a unique, increasing number
    key = base62_encode(n)          # e.g. 9999999 -> 'FXsh'  (short!)
    db.put(key, long_url)           # store the mapping once
    return "short.ly/" + key

# Redirect is a pure read -> cache it; a hit never touches the database.
Write once, read a lot — the read path is cache-first because redirects dominate.

The pre-interview checklist

A quick list to run through under pressure, so you never freeze on a blank whiteboard:

  • ☐ Restated the problem and listed 2–3 core features before designing.
  • ☐ Asked whether it's read-heavy or write-heavy, and the consistency need.
  • ☐ Did a back-of-envelope estimate for QPS and storage.
  • ☐ Drew the end-to-end request path before diving into any one part.
  • ☐ Went deep on the real bottleneck with concrete numbers (TTL, shard key, lag).
  • ☐ Named what I optimized for, what I gave up, and the next bottleneck.
  • ☐ Narrated the whole time and invited the interviewer's input.

This page is the connective tissue of the whole portal — every component deep dive exists so you can execute Move 4 well when the interviewer probes the bottleneck.

Why it matters

  • A structure keeps you calm and makes your reasoning visible, which is the actual signal being graded.
  • It converts scattered component knowledge into a performance — you know when to pull each piece in.
  • The same five moves work on any prompt, so you stop memorizing answers and start deriving them.

If ignored

  • You start designing before clarifying and solve the wrong problem confidently.
  • You burn the whole session on a pretty high-level sketch and never reach a real deep dive.
  • You finish without naming a single trade-off, so the interviewer never sees senior judgement.

Where it fits

  • Wraps around every other topic — concepts give you the vocabulary, components give you the deep dives, this gives you the order.
  • Lives in the first and last few minutes of an interview, where scoping and trade-offs happen.
  • Turns the introduction's 'trade-offs, not technologies' mindset into a repeatable routine.

Related topics

  • Introduction: the mindset these five moves operationalize
  • Scalability: the estimation in Move 2 tells you when to scale out
  • Caching: a go-to deep dive for Move 4 — strategy, TTL, stampede
  • Sharding: another classic deep dive — defend your shard key

Interview lens

Questions it unlocks

  • Design a URL shortener.
  • Design a news feed.
  • Design a photo-sharing service.

60-second answer

Whatever the prompt, I run five moves: clarify and scope, estimate scale, sketch the high-level request path, deep-dive the real bottleneck, then state trade-offs and the next scaling step. The structure keeps me from guessing and makes my reasoning visible, which is exactly what the interviewer is grading. I narrate throughout, because silence hides the signal they want to see.

Common traps

  • Designing before clarifying requirements.
  • Spending all the time on the high-level sketch and never reaching a deep dive.
  • Finishing without naming a single trade-off.

Search topics

↑↓ to move · Enter to open · Esc to close