Back-of-the-envelope estimation
Four numbers, rounded hard, said out loud with the decision attached.
What you will be able to do
- Convert users and actions into requests per second
- Convert record size and write rate into storage per year
- Use rounding constants to do the maths mentally
- Attach a design decision to every estimate you state
- Recognise when an estimate changes the answer and when it does not
What estimation is for
Estimation is not a maths test. It is how you decide which parts of a system deserve complexity. The output of the exercise is not a number — it is a sentence like "we need a cache" or "one database is enough" or "this has to be partitioned by user". If your arithmetic does not change a decision, you have spent minutes for nothing.
The rounding constants
These four constants turn most interview arithmetic into single-digit multiplication. Memorise them and the maths stops being scary.
The method, in four steps
A full worked example
Prompt: a photo-sharing feed. Ten million daily active users, each posting twice a day and scrolling a feed fifty times. Images average 800 KB after compression. Feeds are read far more than written.
WRITES 10M users x 2 posts = 20M uploads/day 20M / 100k s = 200 uploads/s (average) 200 x 5 (peak) = ~1,000 uploads/s at peak READS 10M users x 50 scrolls = 500M feed reads/day 500M / 100k s = 5,000 feed reads/s average 5,000 x 5 (peak) = ~25,000 reads/s at peak read:write ratio = 25:1 -> reads dominate STORAGE 20M x 800 KB = 16 TB per day 16 TB x 365 = ~5.8 PB per year of raw images plus thumbnails (~15%) = ~6.7 PB per year BANDWIDTH uploads: 1,000/s x 800 KB = 800 MB/s in at peak reads: 25,000/s x 80 KB (thumbnail) = 2 GB/s out at peak
Now the interesting part — what those numbers change:
- 25:1 read to write means the feed read path is the system, so caching and precomputation get the design budget.
- 200 uploads a second of 800 KB is fine for direct-to-object-storage uploads and terrible through an app server, so uploads bypass the API tier.
- 5.8 PB a year means images live in object storage with a CDN, never in the database.
- 25,000 reads a second at peak means the feed response cannot hit the database per request — it gets cached per user or assembled from a fan-out store.
Sizes: powers of two
| Power | Exact | Approximate | Use it for |
|---|---|---|---|
| 2^10 | 1,024 | 1 thousand (KB) | A row, a message |
| 2^20 | 1,048,576 | 1 million (MB) | An image, a document |
| 2^30 | 1.07 billion | 1 billion (GB) | A video, a day of logs |
| 2^40 | 1.1 trillion | 1 trillion (TB) | A month of image uploads |
| 2^50 | 1.1 quadrillion | 1 quadrillion (PB) | A year of media at scale |
Treat KB, MB, GB, TB, PB as steps of 1,000 for arithmetic and steps of 1,024 for honesty. The gap never matters in an interview, and pretending it does is worse than rounding.
Two arithmetic shortcuts worth knowing
- Chained division: halving repeatedly is easier than dividing. To get per-second from per-day, divide by 100k — that is two divisions by 10, then by 1,000.
- Per-user, not per-system: work out the cost for one user per day ("20 photo views, 32 KB each"), then multiply by the user count. Multiplying small numbers is more reliable than reasoning about petabytes.
Where estimation goes wrong
Worth remembering
- A day is 100,000 seconds, not 86,400, and a month is 2.5 million seconds. That single rounding makes most estimations mental arithmetic.
- Order of magnitude is the product. 3,300/s versus 3,700/s is the same answer; 300/s versus 30,000/s is a different architecture.
- Every number you say out loud should end in "...which means we need X". Ungrounded arithmetic scores nothing.
- Peak is 3 to 5 times average. Design for peak, cost for average.