Skip to content

Lesson 5 of 32The interview

The System Design Interview

Drive a 45-minute design round with time boxes, a clear structure, and trade-offs at the level you are applying for.

21 min read0/8 questions

System design rounds decide your level more than any other interview. Two candidates with the same coding scores get different offers because one drove the design conversation and the other waited to be asked questions. The good news: the round has a structure, and a structure can be practiced.

What the round is

You get a vague prompt like "Design a URL shortener" or "Design a chat app" and 45 minutes. There is no single right answer. The interviewer wants to see how you break down an ambiguous problem, make reasonable choices, and explain trade-offs. A trade-off is a choice where you gain one thing and give up another, like faster reads in exchange for more storage.

The most common failure is not a wrong design. It is spending 20 minutes on one detail and never getting to a working whole.

The 45-minute structure

MinutesPhaseOutput on the whiteboard
0–5RequirementsA list of functional and non-functional requirements
5–10EstimatesRequests per second, storage per year, read/write ratio
10–15API and data model2–4 endpoints, the main tables or documents
15–25High-level designBoxes and arrows: client, load balancer, services, database, cache
25–40Deep dive1–2 hard parts: scaling the bottleneck, failure handling, consistency
40–45Wrap upBottlenecks left, what you would monitor, what you would build next

Functional requirements are what the system does ("create a short link", "redirect to the original URL"). Non-functional requirements are qualities: latency, availability, durability, scale ("redirects under 50 ms at p99, 99.9% available"). p99 means the 99th percentile: 99 out of 100 requests are at least that fast.

Put it in order6 steps

Put the phases of a design round in order.

  1. Tap the steps below in the right order.
Need a nudge? A hint shows where it starts.

What each level is expected to show

Junior (new grad)Mid levelSeniorStaff
Often asked?Rarely, or a light "design a class / API"Usually one roundOne or two rounds, weighted heavilyTwo rounds, sometimes one open-ended or strategic
ExpectedA working design with the standard pieces, correct API and schemaDrives the conversation, makes estimates, picks a database with a reason, adds caching and queues where justifiedLeads end to end, finds the real bottleneck, discusses failure modes, consistency, cost, and operations without promptingFrames the problem before solving it, challenges requirements, weighs build vs buy and migration paths, and explains how several teams would own and evolve the system
Common gapNot knowing the building blocksNaming tools without saying whyGoing broad and never deepAnswering as a strong senior: deep on components, silent on org, cost and evolution

The staff column is about scope, not more boxes. The Senior and Staff Interview Track lesson has worked examples of what staff interviewers listen for.

Quick check
What most separates a mid-level answer from a junior one?
Need a nudge? A hint rules out a wrong answer.

Driving the conversation

You are the tech lead in the room and the interviewer is a curious colleague. Concretely:

  • Announce the plan. "I'll start with requirements, do quick estimates, sketch the API, then the high-level design, and then go deep on whatever you find most interesting."
  • State assumptions and move on. "I'll assume 100 million new links a month. Tell me if that's off."
  • Check in at transitions. "That's the high-level design. Should I go deeper on the redirect path or on ID generation?"
  • Say the trade-off every time you choose. "NoSQL key-value store: simple lookups by key, easy to scale horizontally, and we don't need joins."

Non-functional requirements, made concrete

Functional requirements say what the system does. Non-functional requirements say how well, and they drive almost every design decision. Vague ones ("it should be fast and reliable") give you nothing to design against. Turn each into a number or a clear choice, and ask the interviewer which matter most:

  • Availability target. 99.9% allows about 43 minutes of downtime a month. 99.99% allows about 4.3 minutes, which usually means no single points of failure and multiple zones. Each extra nine costs far more.
  • Latency target. State a percentile, not an average: "p99 under 200 ms for reads". Averages hide the slow requests users complain about.
  • Durability. Can any write ever be lost? Payments and messages: no, so you need replicated, acknowledged writes. View counters: losing a few seconds on a crash is fine, so you can batch.
  • Consistency. After a write, must every reader see it at once, or is a short delay fine? A bank balance needs strong consistency. A like count or a feed can be eventually consistent.
  • Scale and growth. Users, requests per second, data size, and how fast they grow.
  • Read/write ratio. Read-heavy systems get caches and replicas. Write-heavy ones get queues, batching and partitioning.
  • Cost and operations, at senior level and above: what is expensive to run, and what will page someone at night.

Say these as a short list on the board, then refer back to them when you choose: "We said p99 under 100 ms for redirects, so the lookup needs to hit a cache." Observability, SLIs, and SLOs in the System Design course explains how these targets are measured in production.

Quick check
The interviewer says 'it needs to be highly available'. What is the best next step?
Need a nudge? A hint rules out a wrong answer.

A capacity-estimation drill

Estimates take three to five minutes, and their only job is to tell you which parts of the design are under pressure. Round hard, and say your assumptions. Two facts do most of the work: a day is about 10^5 seconds, and peak traffic is often two to five times the average.

Python
# A photo-sharing app: state the assumptions, then let the numbers fall outdaily_users = 50_000_000uploads_per_user_per_day = 0.2views_per_user_per_day = 30photo_size_mb = 2seconds_per_day = 86_400 # round to 10^5 in your headpeak_factor = 3 # peak traffic vs the daily average write_qps = daily_users * uploads_per_user_per_day / seconds_per_dayread_qps = daily_users * views_per_user_per_day / seconds_per_daystorage_tb_per_year = daily_users * uploads_per_user_per_day * photo_size_mb * 365 / 1_000_000 print(f"writes: {write_qps:,.0f}/s avg, {write_qps * peak_factor:,.0f}/s peak")print(f"reads: {read_qps:,.0f}/s avg, {read_qps * peak_factor:,.0f}/s peak")print(f"read/write ratio: {read_qps / write_qps:.0f} to 1")print(f"new photo storage: {storage_tb_per_year:,.0f} TB per year")
Output
Press Run (⌘ Enter) to see what happens.

Read what the numbers say, not just what they are. 350 writes a second is a single database's comfortable workload. 50,000 reads a second at peak means a cache and a CDN in front of the photos. 7 petabytes a year means photos live in object storage, with only metadata in the database. Change one assumption, such as 100 views per user, and rerun it: the design pressure moves with the numbers.

In the room you do this in your head: "50 million users, 30 views each, is 1.5 billion views a day. Divide by 10^5 and it is 15,000 a second, call it 50,000 at peak." Back-of-the-Envelope Estimation in the System Design course has the full method and the numbers worth memorising.

Predict the outputPython

10 million daily users each send 20 messages a day. Using 10^5 seconds per day, roughly how many messages per second is that on average?

print(10_000_000 * 20 // 100_000)
Need a nudge? Hints walk you through it.

Choosing what to deep dive on

The deep dive is 15 minutes, and that is enough for one or two components, not five. Picking the wrong one, or letting the time drift, is the most common reason a good high-level design scores as mid level. Choose with three filters:

  1. What the numbers stress. The estimates point at it: 50,000 reads a second means the read path and its cache. A write-heavy counter means aggregation and partitioning.
  2. What is hardest to get right. Correctness under concurrency (double booking in a ticketing system, exactly-once in payments), ordering (chat messages), or fan-out (a celebrity's post in a news feed). These are the parts where a real engineer would spend design time.
  3. What the interviewer wants. They often hint ("how would the feed work for someone with 50 million followers?"). If not, offer a choice: "I think the interesting parts are ID generation and the redirect cache. Which would you like?"

Then go deep in a consistent order: the data layout and access pattern, how it scales (partitioning, replication, caching), how it fails and recovers, and the trade-off you chose. Say what you are not covering, so it is a decision rather than a gap.

ProblemCommon deep dives
URL shortenerID generation without collisions, the redirect cache
News feedFan-out on write vs read, the celebrity problem
ChatMessage ordering, delivery to offline users, presence
TicketingHolding seats without double booking, the queue for a hot event
Rate limiterAlgorithm choice, shared counters across many servers

Each row is a full case study in the System Design course. Practice by doing the high-level design in 10 minutes and spending 15 on one row.

Put it in order5 steps

Put a deep dive on one component in a sensible order.

  1. Tap the steps below in the right order.
Need a nudge? A hint shows where it starts.

A worked example in fast-forward: URL shortener

This is the 45-minute version. Design a URL Shortener in the System Design course works through the same problem in full.

Requirements. Create a short link for a long URL; redirect a short link to the long URL. Non-functional: redirects fast (under 50 ms), highly available, links never lost. Reads far outnumber writes.

Estimates. 100 million new links a month is about 40 writes per second. At 100 reads per write, that is about 4,000 redirects per second. Each record is around 500 bytes, so 100M × 500 B = 50 GB a month, or 600 GB a year. Comfortable for one database with replicas; heavy reads mean caching pays off.

API.

POST /api/links        { "url": "https://..." }  ->  201 { "code": "aZ3kP9q" }
GET  /{code}           ->  301 or 302 redirect to the long URL

ID generation. Seven characters of base62 (a–z, A–Z, 0–9) give 62⁷ ≈ 3.5 trillion codes. Encode a unique counter (from a database sequence or pre-allocated ranges per server) to avoid collisions instead of hashing and retrying.

URL shortener, high level
BrowserBrowserLoad balancerLoad balancerLink service: statelessLink servicestatelessRedis: code -> urlRediscode -> urlPostgres: primary + replicasPostgresprimary + replicasID ranges: counter blocksID rangescounter blocksHTTPSget / setSQLnext block

A redirect request GET /aZ3kP9q reaches any of the stateless app servers through the load balancer.

1/5

Deep dive choices an interviewer might push on:

  • 301 vs 302. A 301 (permanent) is cached by browsers, so fewer requests reach you, but you lose click analytics. A 302 (temporary) sends every click through you. Pick based on whether analytics is a requirement.
  • Hot links. A viral link gets millions of hits. The cache handles it; a CDN in front can serve redirects at the edge.
  • Scaling writes. At 40 writes per second one primary is plenty. Say so: not every design needs sharding, and over-engineering is a red flag.
Quick check
Why does the cache belong in this design?
Need a nudge? A hint rules out a wrong answer.
Quick check
The product team wants a click counter for every short link. Which redirect status should you use?
Need a nudge? A hint rules out a wrong answer.

Red flags

  • Drawing boxes before asking a single requirement question.
  • Naming technologies with no reason ("Kafka, Kubernetes, Cassandra") for a system doing 40 writes a second.
  • Ignoring numbers, or doing estimates and never using them.
  • Getting lost in one component for 25 minutes and never finishing the whole.
  • Claiming a design has no downsides. Every choice has one; saying it shows maturity.
  • Not listening when the interviewer steers you. A redirect is usually a hint about what they want to evaluate.

Your checklist

Copy this onto the whiteboard (or the top of the doc) at the start of every practice round:

  1. Functional requirements (2–4 bullets) and what is out of scope
  2. Non-functional: latency, availability, consistency, scale
  3. Estimates: QPS (reads and writes), storage per year, read/write ratio
  4. API: endpoints with request and response
  5. Data model: tables or documents, the key you look things up by
  6. High-level diagram: client, LB, services, data stores
  7. Deep dive: the bottleneck, failure modes, consistency choice
  8. Wrap up: monitoring, what breaks at 10x, what you would build next

The System Design course covers every building block (load balancers, caching, replication, queues, rate limiting) and sixteen full case studies to practice this checklist on.

Match the pairs0/4 matched

Match the requirement to its type.

Choose an item, then its match on the other side.
Key terms
availability target
The share of time a system must work, such as 99.9% (about 43 minutes of downtime a month) or 99.99% (about 4.3).
deep dive
The 10 to 15 minutes spent on one or two components chosen because the numbers or correctness make them hard.
functional requirement
A feature the system must provide, such as "create a short link".
non-functional requirement
A quality the system must have: latency, availability, durability, consistency, scale.
back-of-the-envelope estimate
Quick rough maths on traffic and storage that tells you which components the design needs.
trade-off
A design choice that gains one property at the cost of another, stated out loud in the interview.
deep dive
The part of the round where you go into detail on the hardest or most interesting component.