How do you approach back-of-the-envelope capacity estimation?
959 views
13 of 106
1
The problem
Question presented to candidate:
"Before you draw any boxes, estimate the scale. Say we are building a Pastebin-style service where people share text snippets. How many requests per second, how much storage over five years, how much bandwidth and cache, and roughly how many servers? Talk me through how you get there."
What a strong answer should cover:
Start from stated assumptions (daily active users, actions per user, read:write ratio, object size, retention) and say them out loud before computing
Convert per-day volumes to QPS with 86,400 s/day (or the 10^5 shortcut, about 14% low), separate reads and writes, and apply a peak-to-average factor
Storage = items per day Γ size (including metadata) Γ retention Γ replication factor; bandwidth = QPS Γ payload, and keep bits and bytes apart
Cache sizing from the working set (a hot fraction of what is read per day), and server count from per-server capacity with headroom; Little's law for concurrency
Interpret the result: which resource dominates (here storage, not compute), what that decides in the design, and what breaks first at 10x
Clarifying questions expected:
How many daily active users, and what is the read:write ratio?
How large is a typical item, and how long must it be kept?
Is traffic spiky (launches, time zones) or flat?
Code / implementation expected: No β arithmetic on a whiteboard; the example shows the same calculation as a script.
estimation
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Beginners to system design β you can multiply and divide; nothing else assumed.
Difficulty: Medium
Verified with: Node 22.22 and Python 3.12 (the calculator prints the same output in both).
How to read this doc: Every idea is explained in plain language first, then tagged with π Interview term: so you also learn the exact words an interviewer expects. Every number in the worked example was computed by the example program; the Verified section quotes its full output.
1. Why This Even Matters β A Story First
You are catering a wedding. You do not need to know that guests will drink exactly 437 glasses of water. You need to know whether to bring one case or twenty, whether the van is big enough, and whether you need one bartender or five. So you reason: about 200 guests, maybe three drinks each over the evening, most of them in the hour af
The solution is hidden so you can try first
13 min read Β· 11 sections
4
Read the code
Capacity estimate for a Pastebin-style service, step by step