DEV Community

Real Dev
Real Dev

Posted on

How to run a 45-minute system design interview: a 5-phase plan with one worked example

A student sits down for a design round. The prompt is "Design a system that publishes Class 12 board results to 10 lakh students at 10 am." He starts drawing at once: a gateway, five services, a queue, three databases. At minute 25 the interviewer asks how many requests will arrive at 10:00. He has no number. At minute 45 the board is full and nothing is decided.

He knew every box he drew. What he lacked was a flow. This post gives you one, then runs it on that same prompt so you can see each phase produce something.

The five phases and the clock

Phase Minutes What you leave on the board
Clarify 5 A short list of requirements you both agree on
Estimate 5 Two or three numbers, each with a conclusion
High level 10 Five to eight boxes and the path of one request
Deep dive 15 One hard part, down to data and failure cases
Wrap up 5 The decision, the risks, the next step

That adds up to 40. Keep the other 5 minutes for the greeting and for questions that cut in.

Look at the middle. The high-level picture gets 10 minutes and one deep dive gets 15. Most candidates flip this. They spend 30 minutes drawing boxes and never go deep, and depth is where the interviewer learns how you reason.

Write the start time in a corner of the board. At the end of each phase, say the move out loud: "That's 10 minutes, I'll do estimates now."

You can also say the plan up front: "I'd like to split this into clarify, estimate, high level, one deep dive and a wrap-up. Does that work for you?" Now the interviewer knows you have a plan, and you have a checklist for when nerves hit.

Phase 1: clarify

The prompt is incomplete on purpose. Turn it into a small list you both accept. Split it in two.

Functional requirements say what the system does. Non-functional requirements say how well: latency, availability, consistency, cost.

Ask five to eight questions, then stop. For the board results prompt:

  • Is it read-only for students, or can they do anything else?
  • Can a result change after 10 am?
  • Web only, or phone apps too?
  • Do students log in, or just type a roll number?

Here is the list I would write:

  • Functional: a student enters a roll number and sees their marks.
  • Results are published once. A rare correction may follow.
  • Out of scope: marking, student login, printing mark sheets.
  • Non-functional: p99 latency under 1 second at peak, up at 10:00 sharp, never show a wrong result.

The out-of-scope line matters. Naming what you will not build is a design decision, and it saves you from defending parts nobody asked for.

Phase 2: estimate

The goal is not accuracy. The goal is to find out which part will hurt. Use the same four steps every time:

  1. Write the inputs.
  2. Convert to requests per second.
  3. Apply a peak factor, the ratio of the busiest moment to the average.
  4. Convert to bandwidth or storage if the design depends on it.

Inputs, all stated as assumptions: 10 lakh (1,000,000) students, each checks twice in the first 10 minutes, a peak factor of 3, and a 20 KB result page.

  • Requests: 1,000,000 × 2 = 2,000,000 requests in 600 seconds. 2,000,000 ÷ 600 = about 3,333 req/s on average.
  • Peak: 3,333 × 3 = about 10,000 req/s.
  • Bandwidth: 10,000 × 20 KB = 200 MB/s. Times 8 for bits, that is 1.6 Gbps.
  • Storage: 1,000,000 pages × 20 KB = 20 GB. That fits on one machine.

I checked the math with a short script:

students = 1_000_000
checks_each = 2
window_s = 10 * 60
peak_factor = 3
page_kb = 20

avg_rps = students * checks_each / window_s
peak_rps = avg_rps * peak_factor
mb_per_s = peak_rps * page_kb / 1000
gbps = mb_per_s * 8 / 1000
pages_gb = students * page_kb / 1_000_000

print(f"average: {avg_rps:,.0f} req/s")
print(f"peak:    {peak_rps:,.0f} req/s")
print(f"bandwidth at peak: {mb_per_s:,.0f} MB/s = {gbps:.1f} Gbps")
print(f"all result pages: {pages_gb:.0f} GB")
Enter fullscreen mode Exit fullscreen mode
average: 3,333 req/s
peak:    10,000 req/s
bandwidth at peak: 200 MB/s = 1.6 Gbps
all result pages: 20 GB
Enter fullscreen mode Exit fullscreen mode

Now say what the numbers mean, because a number with no conclusion wastes your five minutes: "Reads dominate. The data is fixed at 10 am. The spike is sudden. So I want to compute nothing at read time."

Do only the estimates that change a decision. If a number shows the problem is small, say so and keep the design small.

Phase 3: high level

Draw the simplest design that meets the list, then say what is missing from it.

For this prompt the numbers point to one idea: precompute and publish. Before 10 am, a batch job reads the final marks and writes one small result page per roll number. A CDN serves those pages. The origin only sees cache misses.

Marks DB -> Publish job -> Result page store
Student phone -> CDN -> (on a miss) Waiting room -> Result service -> Result page store
Enter fullscreen mode Exit fullscreen mode

Name what flows on every arrow. "Publish job reads final marks before 10 am." "CDN returns the cached page on a hit."

The API is one call:

GET /results/{roll_number}
200 -> { "roll_number": "...", "name": "...", "subjects": [...], "total": ..., "version": 1 }
404 -> roll number not found
Enter fullscreen mode Exit fullscreen mode

The data model is just as small. One record per roll number, keyed by roll number, with the marks and a version number. Students never write, so there is no write path at read time.

End the phase with a checkpoint: "Here is the simple version. I think the 10:00 spike is the hard part. Shall I go deep there?" If the interviewer points you somewhere else, follow. That redirect is a hint about what they want to see.

Phase 4: deep dive

Pick the bottleneck. Your estimates already told you where it is. Give the reason out loud: "Reads are cheap, but the 10 am spike is sharp, so I want to look at how pages are served before the first request lands."

Then go in order: data, request path, failure cases, the trade-off you accept.

  • Warm the CDN before 10 am by requesting a sample of pages, so the first wave hits a warm cache.
  • Put a waiting room in front of the origin. If many misses arrive at once, it admits a few requests per second, so a miss stampede cannot overload the result service.
  • For a correction, publish a new page with a higher version number and purge only that key.
  • The trade-off is the cache TTL, how long the CDN keeps a copy. A longer TTL protects the origin. A shorter one makes a correction show up faster.

Think out loud through all of it, including options you drop. "I could compute each result on demand, but 10,000 req/s of computing is wasteful. Precomputing costs time before 10 am and makes reads trivial." The interviewer cannot give credit for thoughts they cannot hear.

When a "what if" comes, use four steps: say the change back in one line, find the box it hits, change one thing, and state what that now costs. "What if one server dies?" The load balancer keeps sending it traffic until a health check fails. Check every 5 seconds and run at least two servers in separate zones. You pay for idle capacity, and a few requests fail until the check notices.

Phase 5: wrap up

Say the decision, the risks and the next step in a few sentences:

"Decision: precompute every result and serve static pages from a CDN. Risks: a wrong publish, which needs a final review before 10 am, and a burst of cache misses, which the waiting room absorbs. Next step: load test at 3 times the estimate."

That is the whole design. It is small because the numbers said it could be small.

If you do not know something

You will hit a question you cannot answer. Say what you know, say where your knowledge stops, and say how you would find out. "I haven't built a geospatial index. I would start with fixed grid cells and measure how uneven they get." A confident guess is worse than that, because it hides the gap from the interviewer and from you.

Practice it on a timer

Take any prompt, set a 45-minute timer, and run the five phases out loud. Record yourself. Check two things afterwards: did every estimate end in a conclusion, and did the deep dive get its full 15 minutes?

Disclosure: I wrote Think Like a System Designer. Chapter 32 plays out this full interview, with a weak and a strong mock transcript. Kindle: https://www.amazon.com/dp/B0HSST5XZ2 · Paperback: https://www.amazon.com/dp/B0HSSLH69G · India (Kindle): https://www.amazon.in/dp/B0HSST5XZ2

Top comments (1)

Collapse
 
riskprepnotes profile image
RiskPrep Notes •

Solid list. One thing I'd add from the hiring side: the follow-up is where AI-assisted answers fall apart. A polished first answer is easy to generate; the second and third follow-up expose whether the candidate has real numbers behind the story. If you can't go three layers deep on your own metrics (control line, actual, how long it held), the interview is over even if the first answer was perfect.