How to Approach a System Design Interview
System Design · Foundations · Basics · 18 min
Run any system design interview with a repeatable 7-step plan, a 45-minute clock and quick capacity math.
A blank whiteboard that fills up in layers: first a list of questions, then a few numbers, then an API, then boxes and arrows, and finally red circles around the weak spots.
The idea in everyday words
An architect never starts by pouring concrete. First they ask who will live in the house and what the budget is, then they sketch the rooms, then the plumbing, and only at the end do they argue about bricks. A system design interview works the same way: questions first, numbers second, boxes third, details last.
Why a framework beats talent
A system design prompt like "Design YouTube" is open on purpose. There is no single right answer. The interviewer wants to watch how you think when things are vague.
Without a plan, people do one of two things: freeze, or start drawing databases in minute one. Both fail. A framework fixes this because you always know the next question to ask.
What interviewers actually grade:
| Signal | What they look for |
|---|---|
| Scoping | Did you ask questions and agree on what to build? |
| Estimation | Can you turn users into QPS (queries per second) and storage? |
| Design | Do the boxes connect and serve every requirement? |
| Depth | Can you go deep on the hardest part? |
| Trade-offs | Do you name the cost of each choice? |
| Communication | Do you think out loud and check in? |
Notice that "picked the perfect database" is not on the list. A reasonable design with clear reasons beats a fancy design you cannot defend.
The 7 steps and a 45-minute budget
This is the same 7-step plan used everywhere on TuringPath (the Playbook, every design lesson). Learn it once.
| # | Step | About | What you produce |
|---|---|---|---|
| 1 | Requirements | 5 min | Functional list ("users can..."), non-functional list (scale, latency, availability, consistency) |
| 2 | Estimates | 3-5 min | QPS (average and peak), storage per year, read:write ratio |
| 3 | API | 3-5 min | 3-5 endpoints with inputs and outputs |
| 4 | Data model | 5 min | Tables / keys that match the API's queries |
| 5 | High-level design | 10 min | Boxes and arrows; walk one request end to end |
| 6 | Deep dives | 10-15 min | 1-2 hard parts in detail (IDs, feed, cache, consistency) |
| 7 | Wrap up: bottlenecks and trade-offs | 2-3 min | Single points of failure, hot keys, what breaks at 10x, a 30-second recap |
The minutes add up to roughly 40-45. If the interview is shorter, shrink steps 2-4, never step 6.
Functional requirements = what the system does ("shorten a URL"). Non-functional requirements = how well it does it ("redirect in under 100 ms", "never lose a photo").
Two habits make this work:
- Check the clock at each step. Running out of time before the deep dive is the most common failure.
- Let each step feed the next. The estimate tells you if you need a cache. The API tells you the data model. The data model tells you the database.
Back-of-envelope math in two minutes
You do not need exact numbers. You need the right order of magnitude (is it 10, 1,000 or 100,000 per second?).
Numbers to remember:
- A day has 86,400 seconds, call it about 100,000 (10^5).
- 1 million requests per day is about 12 per second.
- Peak traffic is often 2-3x the average.
- 1 KB = 10^3 bytes, 1 MB = 10^6, 1 GB = 10^9, 1 TB = 10^12, 1 PB = 10^15.
The recipe:
- Writes per day = daily active users (DAU) × writes per user.
- Write QPS = writes per day ÷ 86,400, rounded up.
- Read QPS = write QPS × reads per write.
- Storage per year = writes per day × bytes per write × 365.
Round up, never down: if you need 231.5 servers' worth of traffic, 231 is not enough.
dau = 10_000_000
writes_per_user = 2
reads_per_write = 10
bytes_per_write = 500
writes_per_day = dau * writes_per_user
write_qps = -(-writes_per_day // 86400) # ceiling division
read_qps = -(-writes_per_day * reads_per_write // 86400)
gb_per_year = writes_per_day * bytes_per_write * 365 / 10**9
print("write QPS:", write_qps)
print("read QPS:", read_qps)
print("storage per year:", round(gb_per_year), "GB")
What the numbers tell you: ~2,300 reads per second fits a small fleet behind a load balancer. 3.6 TB per year fits easily in DynamoDB or S3. If you got 3.6 PB, you would design very differently.
Deep dives and trade-offs: where you stand out
After the high-level design, pick the riskiest requirement and go deep. Good candidates:
- IDs: how do you make unique short codes or order IDs across many servers?
- Hot paths: the read path in a read-heavy app (cache, CDN).
- Fan-out: delivering one post to a million followers.
- Consistency: payments, inventory, anything where "almost right" is wrong.
A quick bottleneck checklist for step 7 (wrap up):
- Is there a single point of failure (one database, one AZ)?
- Is there a hot key (one viral item hammering one partition)?
- What breaks at 10x traffic?
- What happens when a dependency is slow (timeouts, retries, queues)?
Trade-offs are the heart of the interview. Every choice costs something. Say it out loud:
| Choice | You gain | You pay |
|---|---|---|
| Add a cache | Speed, less DB load | Stale data, invalidation work |
| SQL database | Joins, transactions | Harder to scale writes |
| DynamoDB | Predictable scale | Must design keys around queries |
| Async queue | Smooth bursts, retries | Eventual consistency, harder debugging |
On AWS a typical first draft is Route 53 → CloudFront → ALB → ECS/EC2 or Lambda → DynamoDB/RDS, with ElastiCache for hot reads and SQS for background work. On GCP or Azure the framework is identical; only the names change (Cloud Load Balancing / Azure Application Gateway, Firestore or Cloud SQL / Cosmos DB or Azure SQL, Memorystore / Azure Cache for Redis).
Phrases that keep you on track
- Clarify: "Before I design, can I check the scope? Who are the users and what are the top 3 things they do?"
- Scale: "Roughly how many daily users should I plan for? Is it read heavy or write heavy?"
- Scope cut: "I'll leave analytics out of scope for now and come back if we have time."
- Estimate: "Let me do a quick estimate so the numbers drive the design."
- Design: "Let me walk one request end to end through this diagram."
- Trade-off: "I'm choosing X over Y because of requirement Z. The cost is ..."
- Depth: "The hardest part here is ..., so I'd like to spend time on that. Does that sound good?"
- Check-in: "Is there a part you'd like me to go deeper on?"
- Wrap up: "To recap: requirements, design, the main trade-off, and what I'd do next."
Checking in is not weakness. Interviewers often have a deep dive in mind; asking lets them steer you toward it.
Step by step
- 1. Requirements (0-5 min):
Prompt: design a URL shortener. You ask and agree: shorten + redirect are in scope; analytics UI is out. Non-functional: redirects must be fast and highly available.
- 2. Estimates (5-9 min):
3.3M new links/day ÷ 86,400 → 39 write QPS (rounded up). 100 reads per write → 3,820 read QPS. Peak ×2 → 7,718 QPS. Storage: 3.3M × 500 B × 365 ≈ 603 GB/year. Conclusion: read heavy, small data.
- 3. API (9-13 min):
POST /urls {long_url} → {code}. GET /{code} → 302 redirect. Two endpoints are enough to drive the design.
- 4. Data model (13-18 min):
Every query is 'find by code', so a key-value table with partition key = code fits. DynamoDB is a natural AWS choice.
- 5. High-level design (18-28 min):
Users → ALB → stateless link service on ECS (spread over AZs) → DynamoDB. Walk one redirect through it.
- 6. Deep dives (28-41 min):
- Unique codes: each server leases ID ranges from a counter and base62-encodes them, so there are no collisions. 2) Read path: ElastiCache in front of DynamoDB for hot links.
- 7. Wrap up: bottlenecks and trade-offs (41-45 min):
Bottlenecks: the ID counter is a single point of failure, so ranges are leased in blocks and the counter lives in a replicated store. Trade-off: 301 is cached by browsers (less load) but hides clicks; pick 302 to keep analytics. Recap in 30 seconds and name next steps (abuse detection, analytics stream).
Code example
# A pocket "interview planner": time budget + quick estimates for a prompt.
PLAN = [("Requirements", 5), ("Estimates", 4), ("API", 4), ("Data model", 5),
("High-level design", 10), ("Deep dives", 13), ("Wrap up: bottlenecks", 4)]
def ceil_div(a, b):
return -(-a // b)
def estimate(name, dau, writes_per_user, reads_per_write, bytes_per_write, peak):
writes_day = dau * writes_per_user
w = ceil_div(writes_day, 86400)
r = ceil_div(writes_day * reads_per_write, 86400)
gb = ceil_div(writes_day * bytes_per_write * 365, 10**9)
kind = "read heavy" if reads_per_write >= 10 else "balanced"
print(f"{name:14} write {w:>6}/s read {r:>7}/s peak {(w + r) * peak:>7}/s {gb:>9} GB/yr ({kind})")
t = 0
for step, minutes in PLAN:
print(f"{t:>2}-{t + minutes:<2} min {step}")
t += minutes
print("total:", t, "minutes")
print()
estimate("URL shortener", 3_300_000, 1, 100, 500, 2)
estimate("Chat app", 50_000_000, 40, 1, 200, 3)
estimate("Photo sharing", 2_000_000, 1, 50, 2_000_000, 3)Interview tips
Open with questions, not boxes: 'Who are the users, what are the top use cases, and roughly how many users?'
Write the functional and non-functional requirements in a corner of the board and point back to them when you justify a choice.
Announce your time plan: 'I'll spend about 5 minutes on requirements, then estimates, then the design.' It shows control.
Pick deep dives that match the requirement most likely to break, and ask the interviewer if they'd prefer a different one.
End with a 30-second recap plus 'what I'd do next at 10x scale'. Interviewers remember the ending.
Challenge: Capacity Estimator
Write estimate_capacity(dau, writes_per_user, reads_per_write, bytes_per_write, peak_factor) for a back-of-envelope estimate.
Return a dict with whole numbers, always rounded up:
write_qps= ceil(dau × writes_per_user ÷ 86,400)read_qps= ceil(dau × writes_per_user × reads_per_write ÷ 86,400) (from the per-day total, not from the rounded write QPS)peak_qps= (write_qps + read_qps) × peak_factorstorage_gb_per_year= ceil(writes per day × bytes_per_write × 365 ÷ 10^9)
Example: estimate_capacity(10_000_000, 2, 10, 500, 3) → {"write_qps": 232, "read_qps": 2315, "peak_qps": 7641, "storage_gb_per_year": 3650}
Solve it in the browser with tests, hints and an AI coach.
Practice problems
- Encode and Decode TinyURL (Medium)
- Design Twitter (Medium)
- LRU Cache (Medium)
- AWS Well-Architected Framework
More in Foundations
- What Is System Design?
- 10,000 users at once: what really happens
- How the Internet Works: DNS, HTTP, TCP
- API Design: REST, GraphQL, gRPC
Previous: 10,000 users at once: what really happens · Next: How the Internet Works: DNS, HTTP, TCP