Lesson 1 of 5
The system design interview framework
2 min read
System design rounds are open-ended on purpose. Interviewers watch how you think: whether you clarify, make sensible trade-offs and communicate. A clear structure matters more than knowing every technology.
A 45-minute plan
Requirements (5 min)
- Functional: what the system does. "Users shorten a URL; anyone opening the short URL is redirected; optional custom alias and expiry."
- Non-functional: scale, latency, availability, consistency, durability. "100M redirects a day, under 50 ms, highly available; slightly stale analytics are fine."
- Out of scope: say what you're not designing.
- Estimates (5 min): requests per second, storage, bandwidth. Rough numbers drive decisions.
- API and data model (5 min): the main endpoints and tables.
- High-level design (10 min): boxes and arrows: clients → load balancer → services → cache/DB/queue.
- Deep dives (15 min): the interesting parts: scaling the database, caching, a hot key, failure handling.
- Wrap up (5 min): bottlenecks, trade-offs, what you'd monitor, what you'd do next.
Back-of-the-envelope maths
- 1 day ≈ 86,400 s ≈ 10⁵ s. So 1M requests/day ≈ 12 per second; 100M/day ≈ 1,200/s average. Peak is often 2–5× the average.
- Storage = items per day × size × retention. 1M new records/day × 500 bytes × 365 × 5 years ≈ 1 TB.
- Read:write ratio matters: a URL shortener might be 100:1, which says "cache aggressively".
Latency numbers worth remembering: memory read ~100 ns; SSD read ~100 µs; a round trip within a data centre ~0.5 ms; India to US ~200 ms. Disk and network dominate; that's why caching and keeping data close to users work.
Phrases that show maturity
- "It depends on the access pattern; here the reads dominate, so…"
- "I'd start simple with one database and add replicas when reads become the bottleneck."
- "This gives us availability at the cost of slightly stale data, which is acceptable for view counts but not for payments."
Check yourself
- Estimate the requests per second for 50M daily active users who each make 20 requests a day.
- What's the difference between functional and non-functional requirements?
Sign up free to save your progress.