Interview prep · 9 min read

How to approach a system design interview

A four-step plan for the 45 minutes: scope the problem, sketch a high-level design, go deep where it matters and wrap up, with the estimation and availability numbers you need on the way.

There is rarely one right answer. The interviewer wants to see how you turn a vague request ("design a URL shortener") into a concrete system, which trade-offs you notice, and whether you can defend your choices with numbers. This guide gives you a plan for the usual 45 to 60 minutes and the handful of numbers you need along the way. Every problem on the roadmap is practice for exactly this plan.

The four steps #

Most good interviews follow the same arc. Watch the clock: the times below are for a 45-minute slot; stretch them in proportion for longer ones.

Scope and requirements
5–8 min
High-level design
10–15 min
Deep dive
15–20 min
Wrap-up
3–5 min
StepTimeWhat you produce
1. Scope and requirements5–8 minUse cases, scale, the numbers that matter, what is out of scope
2. High-level design10–15 minBoxes and arrows for every use case, end to end
3. Deep dive15–20 minOne or two components examined closely: data model, scaling, failures
4. Wrap-up3–5 minBottlenecks, trade-offs, what you would do next

Step 1: scope and requirements #

Start by asking questions, and write the answers down where both of you can see them. You are looking for two lists.

Functional requirements are what the system does: the use cases. Name them precisely ("a user posts a message", "a follower reads their feed") and agree which are in scope. Three or four is plenty; saying "search and moderation are out of scope for now" is a sign of judgement, not of weakness.

Non-functional requirements are how well it must do it:

Step 2: high-level design #

Draw the system for every use case, end to end, before optimising anything: the client, the entry point (a load balancer or API gateway), the services and the data stores. Walk each use case through the diagram out loud: "the client sends a POST to the API, the API inserts the row, then answers 201".

Keep services stateless where you can, so any replica can serve any request and you scale by adding copies. Put state in stores chosen for their access pattern:

StoreUse it for
Key-value storeLookups by key
Relational databaseTransactions and flexible queries
Object storageLarge blobs
QueueWork that can happen later

At the end of this step you should be able to point at every requirement and say which part of the diagram meets it, even if roughly.

Step 3: deep dive #

Now go deep on the parts that decide whether the design works. The interviewer will often pick one; if not, choose the component under the most pressure from your numbers. Typical deep dives:

Step 4: wrap-up #

Finish by stepping back. Name the bottleneck you would hit first at ten times the traffic, the trade-offs you accepted (staleness for speed, cost for availability), and what you would add with more time: monitoring and alerting, rate limiting, a second region. A calm, honest summary of the design's limits is worth more than a last-minute feature.

Back-of-the-envelope estimation #

Estimation is not about precision. It is about knowing whether a number is a thousand or a million, because that decides whether one machine is enough or you need fifty.

seconds in a day (86,400)
~100,000
seconds in a month
~2.5 million
seconds in a year
~30 million
peak over the average
2–5×

A few habits make it quick:

The tables below are the essentials; Numbers to know has the full cheat sheet (latency, throughput per server, sizes, cloud prices) and a fully worked estimate.

Deep dive Powers of two and ten that come up all the time
UnitRoughly
1 KBa short JSON document or database row
1 MBa photo, a long article with images
1 GBfits comfortably in one machine's memory
1 TBfits on one machine's disk; a big but ordinary database
1 PBneeds a distributed storage system

Latency numbers worth knowing #

You do not need exact figures, but you should know the order of magnitude of the common operations. They explain why caches exist and why cross-region calls hurt.

OperationOrder of magnitude
Read from main memory~100 ns
Read 1 MB sequentially from memory~10 µs
Round trip inside a data centre~0.5 ms
Read from an in-memory cache over the network~1 ms
Simple indexed database querya few ms
Read 1 MB from an SSD~1 ms
Round trip between continents~100–150 ms

Availability in nines #

Availability is the share of time a system works. Each extra nine divides the allowed downtime by ten.

AvailabilityDowntime per yearDowntime per month
99% ("two nines")~3.65 days~7.3 hours
99.9%~8.8 hours~44 minutes
99.95%~4.4 hours~22 minutes
99.99%~53 minutes~4.4 minutes
99.999%~5 minutes~26 seconds

Two rules let you reason about availability on a whiteboard:

How Proschi maps to the interview #

Every practice problem is the interview, written down. The statement is the interviewer's prompt after step 1: the use cases, the scale and the constraints are already agreed. Your design is steps 2 and 3. The tests are the follow-up questions an interviewer would ask.

Deep dive How accurate are the simulation's numbers?

The numbers are deliberately simple teaching values, right to an order of magnitude. They are meant to tell a sound design from a broken one, not to replace a load test; How the simulation works lists every formula and default.

Each step of the roadmap starts with a lesson that explains the concepts behind its problem, then the challenge, then the review of your design.

Further reading #

Go to the roadmap