System Design · Note 14 of 22
Back-of-the-Envelope Estimation
Quick answer
What is back-of-the-envelope estimation in system design?
Back-of-the-envelope estimation is a quick calculation, from stated assumptions, of the load a system must handle — requests per second, peak traffic, storage and bandwidth. It uses rounded numbers and orders of magnitude, not precision, to decide which parts of the design are needed: a cache, replicas, sharding or a CDN.
On this page
An estimate turns vague scale ("lots of users") into numbers that pick the design. State assumptions, round hard, and keep the units.
Numbers to carry
- Seconds in a day: 86,400 ≈ 10^5.
- Powers of two read as powers of ten: 2^10 ≈ a thousand (KB), 2^20 ≈ a million (MB), 2^30 ≈ a billion (GB).
- Sizes: a character ≈ 1 byte, an ID 8 bytes, a text row ≈ 1 KB, a photo ≈ hundreds of KB, a minute of video ≈ megabytes.
2^10 is 1,024, close enough to a thousand to call it a kilobyte. That one shortcut turns powers of two into powers of ten.
Transcript · 5 steps
Latency numbers
- Commonly quoted orders of magnitude, not benchmarks; hardware varies.
- Memory answers in nanoseconds.
- SSD reads in about a hundred microseconds.
- Network round trip in a datacenter: about half a millisecond.
- Disk seek: milliseconds. Across an ocean: a hundred milliseconds or more.
- So: keep hot data in memory, avoid sequential round trips, put data near users.
Stretch time so an L1 cache read takes one second. The real figures are rough, widely quoted orders of magnitude; hardware varies.
Transcript · 6 steps
The method
- Assume daily active users (DAU) and actions per user. Say them out loud.
- Requests a day = DAU × actions.
- Average QPS = requests a day ÷ 86,400.
- Peak QPS = average × a peak factor (often 2–5×).
- Storage = writes a day × bytes each × days kept × copies.
- Bandwidth = QPS × bytes per request, in and out.
Worked example: a photo app
Assume 10M DAU, 50 photo views and 0.2 uploads per user a day, 500 KB a photo, a 3× peak.
Start from assumptions said out loud: 10M daily users of a photo app, 50 views and 0.2 uploads each a day.
Transcript · 7 steps
- Reads outnumber writes about 250 to 1: design the read path first.
- About 17K reads a second at peak: several app servers and a cache.
Storage is writes × size × time. 2M photos a day at about 500 KB each add 1 TB every day.
Transcript · 7 steps
- About 1 TB a day: object storage with metadata in a database.
- Copies multiply the total, so count them.
Bandwidth is QPS × bytes per request. Uploads bring in about 11.6 MB/s — a thin line next to what goes out.
Transcript · 4 steps
- Outbound traffic dwarfs inbound: put a CDN in front.
Common mistakes
- Skipping assumptions: the interviewer cannot follow, or correct, a number with no source.
- Forgetting the peak: average load hides the evening spike.
- Mixing bits and bytes: network links are sold in bits per second.
- Chasing precision: 5,787 and 6,000 lead to the same design.
- Estimating and then ignoring the result: every number should change a box in the diagram.
Interview questions
- How many seconds are in a day? 86,400 — round to 10^5 and say so.
- How do you get peak QPS? Average QPS times a stated peak factor, often 2–5×.
- Why estimate storage per year? It decides whether data fits on one machine or needs sharding and object storage.
- Your service sends 10 GB/s. What follows? One server's network card cannot carry it: spread it over many servers and serve static bytes from a CDN.
Next: How to Answer a System Design Interview · Before this: Design a URL Shortener
Common questions
How do you calculate QPS from daily active users?
Multiply daily active users by the requests each makes a day, then divide by 86,400, the seconds in a day. Multiply the average by a peak factor, often two to five, which you state as an assumption.
Why is 86,400 rounded to 100,000?
Dividing by 10^5 is easy in your head and keeps the answer within the same order of magnitude. The result is about 14% low, which an estimate can live with; say that you rounded.
How do you estimate storage for a system?
Multiply writes per day by the bytes each write stores and by the days you keep the data. Then multiply by the number of copies kept for durability, and add room for indexes and metadata.
Which latency numbers should I remember for interviews?
Orders of magnitude, not exact values: memory in nanoseconds, an SSD read around a hundred microseconds, a round trip inside a datacenter around half a millisecond, a disk seek in milliseconds and a cross-ocean round trip around a hundred milliseconds or more.
How precise does an estimate need to be?
Within an order of magnitude. Its job is to tell you whether one server is enough, whether reads dominate writes and whether data fits on one machine — decisions that do not change between 5,000 and 6,000 QPS.