The system design interview
A structure that works, and what is actually being assessed.
A structure for the 45 minutes
beginnerSpend the first five minutes on requirements, and be specific rather than polite about it. What must it do, for how many people, what is the read to write ratio, what latency is acceptable, what may be stale and what may not, what is explicitly out of scope. Write the numbers on the board, because they are what every later decision will be justified against.
Then estimate out loud for about five minutes: requests per second, storage per year, bandwidth. Orders of magnitude are the goal. A design for twelve requests a second and one for twelve thousand are different systems, and getting that wrong invalidates everything after it, whereas being twenty per cent out costs nothing.
The high-level design should be five or six boxes and no more. Client, edge, service, data store, queue, and whatever this particular problem genuinely needs. Draw the request path first and say what happens at each hop, because a diagram nobody has walked through is a picture rather than a design.
Then depth, which is where most of the assessment happens. Pick the two or three parts that are genuinely hard for this problem, the fan-out, the hot key, the ordering, the consistency boundary, and go deep on those rather than touring everything evenly. If the interviewer steers you somewhere else, go there: they are telling you what they want to assess.
Leave five minutes for bottlenecks and for ten times the load. Say what breaks first and why, what you would measure to see it coming, and what the next change would be. That closing minute or two is where a good candidate becomes an obviously experienced one, because it demonstrates having watched a system get bigger rather than having designed one on paper.
Throughout: think aloud, write down assumptions as you make them, and revisit requirements openly if the design has drifted from them. The interviewer cannot score reasoning they cannot hear, and silence during the hard part is indistinguishable from being stuck.
What is the most common way strong engineers fail a system design interview?
Evidence · 1 source
- 01Jeff Dean, Latency numbers every programmer should know
The latency ladder the estimation step depends on, from a memory reference in tens of nanoseconds to a cross-continental round trip in over a hundred milliseconds.
Answers are generated and can be wrong. The topic above is the reviewed version.
Back-of-envelope estimation
intermediateEstimation is arithmetic done out loud, and the numbers to memorise are few. A day is 86,400 seconds, near enough 100,000. So a million events a day is about 12 a second, and a billion is about 12,000 a second. Peak is commonly two to three times average, and traffic is never spread evenly across the day.
Storage follows the same shape. A thousand bytes per record at a million records a day is a gigabyte a day, roughly a third of a terabyte a year. A million users with a kilobyte of profile each is a gigabyte in total, which is a laptop rather than a cluster and worth saying so plainly when someone proposes sharding it.
A few latency numbers anchor everything else and are worth knowing to an order of magnitude: memory access in tens of nanoseconds, an SSD read in tens of microseconds, a data centre round trip around half a millisecond, and a cross-continental round trip well over a hundred milliseconds. Those are the ratios behind almost every caching and placement decision you will ever justify.
Round aggressively and say that you are. Use 100,000 seconds for a day, treat a kilobyte as a thousand bytes, call a month thirty days. Nobody is checking your arithmetic, and precision is the enemy of finishing the calculation in the ninety seconds it deserves.
The point is not accuracy but the class of system. Twelve requests a second is one server and no discussion. Twelve thousand is a fleet, a cache and a real conversation about the data layer. Being twenty per cent out changes nothing; being out by a factor of a thousand invalidates every design decision that follows, which is the failure the exercise exists to prevent. Sanity-check the answer against something you know. If your estimate implies more storage than a large public dataset, or more traffic than a well-known service, one of the inputs is wrong. That instinct, checking a result against the world rather than against the sum, is what people mean by engineering judgement in this context.
A million users each with a kilobyte of profile data. How much storage?
Evidence · 1 source
- 01Jeff Dean, Latency numbers every programmer should know
The specific figures quoted here: memory access in tens of nanoseconds, an SSD read in tens of microseconds, a data centre round trip around half a millisecond, and a cross-continental round trip well over a hundred milliseconds.
Answers are generated and can be wrong. The topic above is the reviewed version.
Talking about tradeoffs
advancedEvery design decision costs something, and naming the cost unprompted is the strongest signal available in this format, because it is the thing that distinguishes having operated a system from having read about one. Interviewers are not testing whether you can name Redis; they are testing whether you know when it is the wrong answer.
The shape of a strong statement is decision, cost, and the condition that would change it. I would cache this with a sixty second expiry is a decision. Accepting up to a minute of staleness, because prices update hourly, is the cost. And if the prices became real-time I would drop the cache and read through is the condition. Three clauses, and the third is the one almost nobody says.
Volunteer the failure mode as well. What happens under partition, on a hot key, when the cache is cold after a restart, when the third party is down. Saying it yourself is worth far more than being asked, because being asked means the interviewer noticed the gap before you did, and that difference is exactly what the rubric is trying to detect.
Quantify wherever a number is available, even roughly. Adds a network hop, so maybe two milliseconds on the read path. Doubles our write volume. Saves an engineer a week of operating it. Numbers turn a preference into an argument, and an argument can be examined, which is the conversation you want to be having.
Say what you would not do and why, because a design defined only by inclusions looks like a list of technologies. I would not shard this yet, because the whole dataset fits in memory and sharding is the one decision that is genuinely hard to reverse. That single sentence demonstrates more judgement than three additional components.
Finally, be willing to change your mind when the interviewer pushes, and say what changed it. Defending a position past the point of evidence is a stronger negative signal than the original choice, and updating cleanly in front of someone is the behaviour they are hoping to see in a design review next quarter.
Which clause do candidates most often leave out of a design statement?
Answers are generated and can be wrong. The topic above is the reviewed version.