Back-of-the-Envelope Estimation
Turn daily users into requests per second, storage, bandwidth and servers with rounded arithmetic done out loud, and use each number to decide.
On this page
A candidate designing a photo-sharing app is told "10 million daily users". They spend four minutes dividing by 86,400, get 3,472.2 requests a second, and then draw the design they would have drawn for 30 or for 300,000. The interviewer learned nothing about their judgment.
Estimation has one job: find out which numbers are big enough to change the design. You want the right order of magnitude in under four minutes, out loud, and then a sentence that starts "so...".
The handful of facts you need
Almost every estimate is built from these conversions. Memorize them.
| Power of two | About | Name | Bytes |
|---|---|---|---|
| 210 = 1,024 | 103 | thousand | KB |
| 220 | 106 | million | MB |
| 230 | 109 | billion | GB |
| 240 | 1012 | trillion | TB |
| 250 | 1015 | quadrillion | PB |
The powers of two drift from the powers of ten (240 is about 10% more than 1012), which never matters at this precision. Interviews use powers of ten: 1 KB = 1,000 bytes.
- A day is about 100,000 seconds. The real figure is 86,400. Dividing by 100,000 gives rates about 14% low; say so once and move on.
- A month is about 2.5 million seconds (30 × 86,400 ≈ 2.6 million). A year is about 30 million (365 × 86,400 ≈ 31.5 million).
- 1 million a day is about 10 a second. 1 billion a month is about 400 a second.
- Sizes: an ASCII character is 1 byte, an integer or a timestamp 8 bytes, a UUID 16 bytes. A small database row is a few hundred bytes. Photo sizes and server capacity are for the interviewer to give or for you to state as assumptions.
Latency figures (a memory read, a disk seek, a cross-region round trip) live in numbers to know.
From daily users to servers
The core chain: daily users times actions per user gives requests a day; divide by 100,000 for the average rate; multiply by a peak factor; divide by what one server handles. Step through it for the photo app.
requests/day = daily users × requests per useraverage QPS = requests/day ÷ 100,000peak QPS = average QPS × peak factorservers = peak QPS ÷ QPS per server ÷ 0.7- daily users
- 10 million
- requests each
- 30
1The interviewer gives 10 million daily active users. You ask how active they are and hear: about 30 API requests each a day (loading feed pages, liking, commenting).
- daily users
- 10 million
- requests each
- 30
- requests/day
- 3 × 10⁸
210 million × 30 = 300 million requests a day. Big numbers are easier as powers of ten: 107 × 30 = 3 × 108.
- requests/day
- 3 × 10⁸
- average QPS
- 3,000
3Divide by 100,000 seconds: 3 × 108 ÷ 105 = 3,000 a second on average. The exact figure is about 3,500; the rounding is fine for sizing.
- average QPS
- 3,000
- peak factor
- 3
- peak QPS
- 9,000
4Traffic is not flat: evenings are busier than nights. Assume peak is 3 times average for a consumer app in one country, and say it is an assumption. Peak: 9,000 a second.
- peak QPS
- 9,000
- per server
- 1,000
- servers
- 9
5Assume one stateless API server handles about 1,000 requests a second (ask, or state it). 9,000 ÷ 1,000 = 9 servers at full load.
- peak QPS
- 9,000
- per server
- 1,000
- servers
- 13
6Never plan to run servers at 100%. At 70% target load: 9 ÷ 0.7 ≈ 13 servers. The decision: this is a small fleet behind a load balancer, not a scaling problem.
Each number should end with "so": so it fits on one machine, so it needs a CDN, so we must partition.
Storage, bandwidth and memory
Storage is items a day × bytes per item × days kept × copies. Bandwidth is requests a second × bytes per response. Cache memory is the number of hot items × bytes per item. Try each before opening the answer.
How much disk do one year of uploaded photos need, counting all copies?
- 2 million photos uploaded a day
- 500 KB per stored photo
- 3 copies of every photo for durability
Show the working
- Per day: 2 × 106 × 5 × 105 B = 1012 B = 1 TB
- Per year: 1 TB × 365 = 365 TB
- Three copies: 365 × 3 ≈ 1,100 TB, about 1 PB
Estimate 1 PB (anything from 300 TB to 3 PB is a good answer)
A petabyte a year rules out keeping photos in a database. They go to blob storage; the database keeps a small row per photo.
How much photo data per second goes out to viewers on average?
- 10 million daily users
- Each views 50 photos a day
- A displayed photo is 200 KB (a smaller version than the stored original)
Show the working
- Views a day: 107 × 50 = 5 × 108
- Per second: 5 × 108 ÷ 105 = 5,000 views a second
- 5,000 × 200 KB = 109 B/s = 1 GB/s
Estimate 1 GB/s (anything from 300 MB/s to 3 GB/s is a good answer)
1 GB/s is 8 Gbit/s on average and about 24 Gbit/s at a 3x peak. That is a job for a CDN, not for your API servers.
You want the metadata of every photo from the last 7 days in memory. About how much memory is that?
- 2 million photos uploaded a day
- 1 KB of metadata per photo (owner, caption, timestamps, storage key)
Show the working
- Photos in 7 days: 2 × 106 × 7 = 1.4 × 107
- 1.4 × 107 × 1 KB = 1.4 × 1010 B = 14 GB
Estimate 14 GB (anything from 5 GB to 50 GB is a good answer)
14 GB fits on one cache node. Say that, then add a replica so a node failure does not empty it.
Two traps on the way. Network links are quoted in bits a second and storage in bytes: multiply bytes by 8. And durable storage almost always keeps more than one copy, so state your replication factor or the storage figure is a third of the real one.
How precise to be
| Option | Good at | Bad at | Pick it when |
|---|---|---|---|
| Exact arithmetic | No rounding error. | Slow and error-prone at a whiteboard. The extra digits change no decision. | Never in an interview. |
| Powers of ten only | Very fast; good for "is this big?" checks. | Rounding 3,000 to 1,000 or 10,000 can be off by 3 times, which can flip a decision near a limit. | A first sanity check, or when the interviewer asks for a rough order. |
| One or two significant figures Usual default | Fast, rarely off by more than 20%, easy to follow. | You must say where you rounded so the interviewer can check you. | The default for every estimate. |
What would make you more careful: a number close to a real limit. If peak traffic comes out at 900 a second and your assumed single-server limit is 1,000, the rounding matters; say "that is close to one server's limit, so I'll plan for two or more".
In the interview
Estimate after clarifying and before the API, as in the framework. Ask for the inputs, state any you assume, and compute only what can change the design: usually peak rate, total storage, and bandwidth or cache size.
- "I'll round a day to 100,000 seconds, so my rates are a bit low."
- "That's 1 GB a second of images, so images go through a CDN and never touch the API servers."
- "Storage is 1 PB a year, so photos go in blob storage and the database only holds metadata."
Assume 10 million daily users. How much traffic is that?
About 30 requests each is 300 million a day. Over roughly 100,000 seconds that's 3,000 a second, and I'll assume 9,000 at peak. Around 13 API servers at 70% load. So the API tier is not the hard part.
Then what is?
The photos. 5,000 views a second at 200 KB is 1 GB a second out, and a petabyte a year in. The design is mostly about blob storage and the CDN.
Follow-ups you should expect:
- "Where does a peak factor of 3 come from?" It is an assumption about daily patterns. Say what would raise it: a single time zone, a live event, a launch.
- "How sure are you?" "Within a factor of 2 or 3, which is enough to choose the architecture."
Common mistakes
A chat app has 20 million daily users, each sending 40 messages a day. About how many messages a second is that on average?
Your estimate says 8,000 messages a second; the exact figure with 86,400 seconds is about 9,300. What should you do?
Images go out at 1 GB/s on average. What network capacity is that in the units links are sold in?
What to practice next
Next, turn the requirements into endpoints in API Design. For the estimates in a full case, see Design Video Streaming, where bandwidth drives everything.