A method for system design rounds
Large-system design questions feel open-ended, but strong answers follow the same path every time: agree what is being built, make it work on one machine, find what breaks, and scale only that part, with numbers at each step.
The path
- Clarify. What must it do, for how many users, and how reliable must it be? Write the answers down where the interviewer can see them.
- One machine. Design the simplest version that would work if everything fitted on one server.
- Estimate. Requests per second, bytes per request, storage per day. Round aggressively.
- Find the limit. Which resource runs out first on that one machine: CPU, memory, disk, or network?
- Scale that part. Add machines, a load balancer, replicas, a cache or a queue, only where the numbers say so.
- Break it. Take away a machine, then a whole site. Say what the user experiences and how the system recovers.
Numbers worth memorising
- A day has 86,400 seconds; use 100,000 for estimates.
- 1 million requests a day is about 12 a second. 1 billion a day is about 12,000 a second.
- Peak traffic is often two to three times the daily average; say which multiplier you are using.
- 1 KB × 1 million = 1 GB. 1 KB × 1 billion = 1 TB.
- 99.9% availability allows about 43 minutes of downtime in a 30-day month; 99.99% allows about 4 minutes.
A two-minute estimate
Prompt: "Store metrics from 100,000 servers, each sending 100 values every 10 seconds, and keep them for 30 days."
writes/second = 100,000 servers × 100 values ÷ 10 s = 1,000,000 values/s bytes/second = 1,000,000 × ~16 bytes (time + value) ≈ 16 MB/s per day = 16 MB/s × 100,000 s ≈ 1.6 TB/day 30 days = 1.6 TB × 30 ≈ 48 TB before compression or copies with 3 copies ≈ 150 TB
Two conclusions follow, and saying them is the point of the arithmetic: a million writes a second will not go through one machine, so ingestion must be split across many; and 150 TB will not fit on one, so storage must be split too. Now the design has reasons.
What fails, and what the user sees
For each box you draw, answer three questions aloud: what happens if this one stops, how does the system notice, and what does the user see while it recovers? "Recent data is delayed by a minute, nothing is lost" is a far stronger answer than "it is highly available".
Common mistakes
- Drawing a many-box architecture before agreeing what the system does.
- No numbers. Without an estimate, every design choice is an opinion.
- Naming products instead of describing what the component must do.
- Adding a cache or a queue without saying which limit it relieves.
- Never mentioning failure, monitoring, or how a change would be rolled out safely.