Back-of-the-Envelope Estimation
Somewhere early in most system design interviews, there's a pause where someone asks, "So how big is this?" The numbers you come up with in the next few minutes decide a lot: whether the data fits on one machine, whether one database can take the writes, whether you need a cache, a CDN or a sharded store. Back-of-the-envelope estimation is the skill of getting those numbers fast, roughly right, and in a form that drives the design.
The important word is drives. Interviewers don't care whether you compute 4,630 or 5,000 writes per second. They care whether you notice that 5,000 writes per second is fine for one well-provisioned Postgres primary, while 500,000 is not, and change the design accordingly. Estimation that doesn't lead to a decision is wasted time, and many candidates spend five minutes producing numbers they never use again.
We'll cover:
- The handful of conversions and reference numbers worth memorizing.
- A repeatable method: users to QPS, QPS to servers, writes to storage, and bandwidth.
- Worked examples for common problems, each ending in a design decision.
- The thresholds where designs change, and the mistakes that cost candidates points.
The Numbers to Memorize
You don't need many, but you need them to be automatic.
Time
| Period | Seconds | Shortcut |
|---|---|---|
| 1 day | 86,400 | ~10⁵ (rounded up) |
| 1 month | ~2.6 million | ~2.5 × 10⁶ |
| 1 year | ~31.5 million | ~3 × 10⁷ |
The most useful consequences:
- 1 million per day ≈ 12 per second. (1,000,000 / 86,400 ≈ 11.6.)
- 1 billion per day ≈ 12,000 per second.
- 100 million per month ≈ 40 per second.
Using 10⁵ seconds per day makes the math easy and underestimates by about 15%, which is fine, because you'll multiply by a peak factor anyway. Just be consistent.
Size
| Unit | Bytes | Power of 2 |
|---|---|---|
| KB | 10³ | ~2¹⁰ |
| MB | 10⁶ | ~2²⁰ |
| GB | 10⁹ | ~2³⁰ |
| TB | 10¹² | ~2⁴⁰ |
| PB | 10¹⁵ | ~2⁵⁰ |
And the sizes of common things:
- IDs and numbers: a 64-bit integer or timestamp is 8 bytes; a UUID is 16 bytes (36 as a string).
- A short text record (a tweet, a chat message, a URL mapping with metadata): a few hundred bytes. Use 500 bytes to 1 KB once you include IDs, timestamps and indexes.
- A user profile row: around 1 KB.
- A compressed photo: a few hundred KB to a few MB. Use 500 KB for a mobile upload, 2 MB to 5 MB for an original.
- Video: 1080p streams at roughly 5 Mbps, which is about 40 MB per minute (5 Mbps ÷ 8 = 0.625 MB/s × 60 ≈ 37.5 MB). 4K is roughly 3 to 4 times that.
Watch bits versus bytes. Network speeds are in bits per second: a 10 Gbps link moves about 1.25 GB per second.
Latency
These are approximate and vary with hardware, but the orders of magnitude are what matter:
| Operation | Rough time |
|---|---|
| Main memory reference | ~100 ns |
| Read 1 MB sequentially from memory | tens of µs |
| NVMe SSD random read | tens of µs to ~100 µs |
| Round trip within a datacenter | ~0.1 to 0.5 ms |
| Read 1 MB sequentially from SSD | ~0.2 to 1 ms |
| Redis GET over the network | ~0.5 to 1 ms |
| Indexed database lookup, end to end | ~1 to 5 ms |
| Spinning disk seek | ~5 to 10 ms |
| Round trip across the US | ~60 to 80 ms |
| Round trip US to Europe | ~80 to 100 ms |
| Round trip US to Australia | ~150 to 200 ms |
Three takeaways show up again and again in designs:
- Memory is about 1,000 times faster than a network hop. That's why caches matter and why a local in-process cache beats even Redis for the hottest keys.
- Cross-region round trips are 100+ ms. A design that makes several sequential cross-region calls per request can't meet a 200 ms budget. See /system-design/multi-region.
- Sequential beats random, especially on spinning disks. It's why logs, LSM trees and Kafka are built on append-only writes.
Throughput of Common Components
Again rough, for a single well-provisioned node with simple operations. Use them as order-of-magnitude planning numbers, not promises:
| Component | Rough capacity per node |
|---|---|
| Stateless app server | ~1,000 to 10,000 requests/s, depending on work per request |
| Postgres or MySQL | ~10,000+ simple indexed reads/s; writes in the low thousands to ~10,000/s |
| Redis | ~100,000+ simple operations/s (more with pipelining) |
| Cassandra or similar LSM store | ~10,000s of writes/s |
| Kafka broker | ~100s of MB/s of throughput |
| Connection server holding WebSockets | ~50,000 to 100,000+ mostly idle connections |
| Network card | 10 to 25 Gbps (1.25 to 3 GB/s) |
| A large server's RAM | hundreds of GB, up to a few TB |
You don't need precise benchmarks. You need to know that one Redis node handles around 100,000 operations per second, and one relational primary handles thousands of writes per second, so you can tell in a second whether a number is "one box," "a few boxes" or "needs sharding."
The Method
A repeatable sequence keeps you from getting lost and makes it easy for your interviewer to follow. State your assumptions out loud as you go.
1. Start from users. Monthly active users (MAU) or daily active users (DAU), from the interviewer or a reasonable assumption. DAU is usually 20% to 50% of MAU for a popular consumer app.
2. Actions per user per day. How many writes (posts, messages, uploads) and reads (feed views, searches) does a typical active user do?
3. Average QPS. DAU × actions per day ÷ 86,400, or just divide by 10⁵.
4. Peak QPS. Traffic isn't flat. Daily peaks are typically 2 to 3 times the average; events (a sale, a goal in a big match, a celebrity post) can be 10 times or more. Design for the peak, and say which factor you're using.
5. Read/write ratio. Most consumer systems are read-heavy: 10:1 to 100:1 or more. This tells you whether to optimize writes (sharding, LSM stores, queues) or reads (caches, replicas, precomputation).
6. Storage. writes per day × size per write × retention, then multiply by the replication factor (usually 3) and allow some overhead for indexes. Do it per year, then for the retention period.
7. Bandwidth. QPS × response size for egress, write QPS × request size for ingress. This is what decides whether you need a CDN.
8. Servers or shards. peak QPS ÷ capacity per node, plus headroom (run at 50% to 70% so you can lose a node or absorb a spike).
Then the most important step: say what it means for the design.
Worked Examples
A Twitter-Like Feed
Assume 200 million DAU. Each user posts 2 tweets a day and views their timeline 50 times, with about 20 tweets per view.
- Writes: 200M × 2 = 400M tweets/day ÷ 86,400 ≈ 4,600 tweets/s on average. At a 3× peak, about 15,000/s.
- Timeline reads: 200M × 50 = 10B timeline views/day ≈ 115,000 views/s, about 350,000/s at peak. Each view returns 20 tweets, so that's millions of tweet lookups per second.
- Storage: 400M tweets/day × 1 KB ≈ 400 GB/day, or about 146 TB per year. With 3× replication, roughly 450 TB per year of text, before any media.
- Media: if 10% of tweets have a 500 KB image, that's 40M × 500 KB = 20 TB/day of images, about 7 PB per year. Media dwarfs text by 50 to 1.
What this decides:
- 15,000 writes/s is too much for one relational primary to take comfortably, but it's not extreme: a handful of shards, or a write-optimized store, handles it.
- 350,000 timeline reads/s at peak can't touch a database on every request. Timelines must be precomputed and cached (fan-out on write into per-user timeline caches in Redis), with a special case for accounts with millions of followers. See /system-design/twitter.
- Images go to object storage behind a CDN, never in the database.
A URL Shortener
Assume 100 million new short URLs per month, a 100:1 read-to-write ratio, and 5 years of retention.
- Writes: 100M/month ≈ 40/s. Even at a 10× peak, 400/s. One database handles this easily.
- Reads: 100 × 40 = 4,000 redirects/s on average, maybe 20,000/s at peak.
- Storage: 100M × 12 × 5 = 6 billion URLs. At 500 bytes each, 3 TB. With replication, about 9 TB.
- Key space: 7 characters of base62 gives 62⁷ ≈ 3.5 trillion codes, which is nearly 600 times 6 billion. Seven characters is plenty.
What this decides: writes are trivial, so don't over-engineer the write path. Reads are the real load, and since a short URL almost never changes, they're perfect for caching: with a skewed distribution, a cache holding the hottest 20% of URLs serves most traffic. 3 TB fits on one large database node, but sharding by short code is cheap insurance for growth. See /system-design/url-shortener.
A Video Platform
Assume 500,000 uploads per day, averaging 8 minutes, and 20 million concurrent viewers at peak watching at an average of 4 Mbps.
- Raw upload storage: an 8-minute 1080p video at ~40 MB/minute is about 320 MB. 500,000 × 320 MB = 160 TB/day of originals.
- Transcoded renditions: storing several resolutions (1080p, 720p, 480p, 360p...) adds roughly as much again, since the lower ones are much smaller. Call it ~300 TB/day total, which is around 100 PB per year.
- Egress: 20 million viewers × 4 Mbps = 80 Tbps at peak. A single server's NIC is 10 to 25 Gbps, so even ignoring everything else, that's thousands of servers' worth of network capacity just to stream bytes.
What this decides: storage is in petabytes, so it must be object storage with cheaper tiers for rarely watched videos. Egress at 80 Tbps is impossible from a few datacenters and expensive from anywhere; it has to be served from a CDN at the edge, ideally with popular videos cached close to viewers. Upload ingestion needs resumable, chunked uploads straight to object storage. See /system-design/youtube.
Sizing a Cache
Assume a product catalog with 50 million products at 5 KB each, and reads following a typical skew where 20% of products get 80% of views.
- Full dataset: 50M × 5 KB = 250 GB.
- Hot set: 20% of that is 50 GB, which fits in the memory of a single large Redis node, or comfortably across a small cluster.
What this decides: a 50 GB cache serves most reads. You don't need to cache everything; you need to cache the hot set. And the full 250 GB would fit too if you wanted, on a few nodes, which is useful to know if a near-100% hit rate matters.
Counting Connections
A chat app with 50 million DAU, of whom 20% are online at peak, each holding one WebSocket.
- Concurrent connections: 50M × 20% = 10 million.
- Servers: at 100,000 connections per server, 100 connection servers, plus headroom, say 150.
- Heartbeats: one ping every 30 seconds from 10 million clients is about 330,000 tiny frames/s across the fleet, about 2,000 per server per second, which is negligible.
What this decides: the connection tier is a fleet of around 150 stateful servers, so you need a way to route messages to the right server (pub/sub or a registry). See /system-design/real-time-updates.
Thresholds Where Designs Change
The point of estimating is to land on one side of a line. These lines are worth knowing, as rough guides rather than hard limits:
- Does it fit in memory on one machine? Up to tens or a few hundred GB, comfortably. That's when "load it all into a Redis node" or "keep it in process" is a real option.
- Does it fit on one database node? A few TB on one node is normal for Postgres or MySQL. Tens of TB starts to hurt for backups, index builds and recovery time, so plan to shard or use a distributed database.
- Can one primary take the writes? Low thousands of writes per second, yes. Tens of thousands, probably shard or use a write-optimized store like Cassandra or DynamoDB. Hundreds of thousands, definitely, and consider buffering in a queue.
- Can reads come from the database? Thousands per second, yes, with read replicas. Hundreds of thousands, put a cache in front.
- Do you need a CDN? When egress reaches many Gbps, or the content is static and users are global. Video and images almost always.
- Do you need a queue? When write spikes are much bigger than what downstream systems can absorb, or when work can be done later. A 10× burst for a few minutes is exactly what a queue smooths out.
Always finish an estimate with a sentence that starts "so...": "So the writes fit on one primary, but the reads need a cache." "So storage is petabytes, which means object storage with a CDN in front." That sentence is the part your interviewer is actually grading.
Three More Estimates Worth Knowing
QPS and storage are the usual suspects, but three other quick calculations come up often enough to keep ready.
Concurrency: Little's Law
Little's Law says the average number of requests in flight equals the arrival rate times the time each one takes:
in-flight = throughput × latency
At 10,000 requests per second with a 200 ms average latency, about 2,000 requests are in progress at any moment. That number sizes things that are easy to forget:
- Thread pools and worker counts. A service with blocking I/O needs enough workers for 2,000 concurrent requests, spread over its instances.
- Database connection pools. If each request holds a database connection for 20 ms, then 10,000 requests/s × 0.02 s = 200 connections in use. Postgres gets unhappy with thousands of direct connections, so this tells you whether you need a pooler like PgBouncer.
- The effect of slowdowns. If a dependency slows from 200 ms to 2 s, in-flight requests jump tenfold, to 20,000, at the same traffic. Pools fill, queues grow and the service falls over, even though traffic didn't change. This is why timeouts and circuit breakers matter.
Availability: Counting Nines
| Availability | Downtime per year | Downtime per month |
|---|---|---|
| 99% | ~3.65 days | ~7.3 hours |
| 99.9% | ~8.8 hours | ~44 minutes |
| 99.99% | ~53 minutes | ~4.4 minutes |
| 99.999% | ~5.3 minutes | ~26 seconds |
Two rules of thumb follow:
- Dependencies in series multiply. A request that needs three services, each at 99.9%, succeeds about 0.999³ ≈ 99.7% of the time. Every hard dependency you add lowers your ceiling.
- Redundancy in parallel helps a lot. Two independent replicas at 99% each are both down only 0.01 × 0.01 = 0.01% of the time, so the pair is 99.99% available, as long as failures really are independent (different racks, zones or regions) and failover works.
Four or five nines leave no time for a human to respond to an incident, so they imply automated failover. That's a design consequence worth saying out loud.
Cost
For storage- and bandwidth-heavy systems, a rough monthly bill is a useful sanity check. Cloud object storage runs on the order of a couple of cents per GB per month for the standard tier, less for infrequent-access and archive tiers, and internet egress is typically several cents per GB before volume discounts.
At those rates, 100 PB of standard object storage is on the order of $2 million per month, which is why video platforms move old, rarely watched renditions to colder tiers and delete renditions nobody requests. And 80 Tbps of peak egress is many PB per day, which is why large platforms negotiate CDN contracts or build their own edge caches inside ISP networks. You don't need exact prices; you need to notice when a design is burning money and say what you'd do about it.
Common Mistakes
- Too much precision. Writing 4,629.63 writes per second wastes time and signals you don't know what matters. Round to one significant figure: about 5,000.
- Estimating things that don't matter. If the design doesn't change whether storage is 10 TB or 30 TB, don't spend three minutes on it. Many interviewers now prefer that you skip upfront estimates and do the math when a design decision needs it.
- Forgetting the peak. Averages hide the spikes that break systems. A flash sale or a live event can be 10 to 100 times the average for a few minutes. See /system-design/flash-sale.
- Forgetting replication and overhead. Storage is usually 3× for replicas, plus indexes, plus room to grow. Leaving it out understates the real footprint by more than half.
- Mixing up bits and bytes. Network is bits; storage is bytes. Divide by 8.
- Unit drift. Going from KB to GB is a factor of a million, not a thousand. Write the units next to every number.
- Treating per-node numbers as precise. "Postgres does exactly 12,000 writes per second" isn't a thing. Hedge with "on the order of," and say what affects it (row size, indexes, disk, durability settings).
- Not sanity-checking. If your estimate says Instagram stores 3 GB of photos a day, something is off by orders of magnitude. Ask whether the result feels plausible.
Tricks for Doing It Fast
- Work in powers of ten. 200 million × 2 KB = 2 × 10⁸ × 2 × 10³ = 4 × 10¹¹ bytes = 400 GB. Multiply the leading digits, add the exponents.
- Use convenient round numbers. 86,400 becomes 10⁵. 1,024 becomes 1,000. 30 days becomes a month.
- Work per second first, then scale. Most capacity numbers are per second, so converting daily totals to per-second rates early keeps everything comparable.
- Keep a running table on the whiteboard: DAU, writes/s, reads/s, storage/year, egress. You'll refer back to it during deep dives.
- Ask for numbers when they matter. "Do you have a sense of daily active users, or should I assume around 100 million?" is perfectly good interview behavior, and it saves you from building on a number the interviewer disagrees with.
Estimation in an Interview
When to Do It
Most interviewers want a quick estimate after the non-functional requirements, when you've established scale. Keep it to two or three minutes, and only compute the numbers that will shape the design: usually peak write QPS, peak read QPS, total storage and, for media-heavy systems, egress bandwidth.
Some interviewers prefer you skip the upfront math and jump to the design. A good compromise is to say: "I'll note that this is read-heavy at a scale of around 100,000 reads per second, and come back to exact numbers when we size the cache and the database." Then do the math at that point, when it decides something.
Common Follow-ups
- "How many servers would you need?" Peak QPS ÷ per-server capacity, with headroom, and a sentence on what limits per-server capacity (CPU, memory, connections, network).
- "Will this fit in one database?" Compare total storage and write rate to single-node thresholds, and say when you'd shard.
- "How big should the cache be?" The hot set, usually a fraction of the full dataset, based on how skewed access is.
- "What if traffic grows 10×?" Which component crosses a threshold first? That's usually the database primary or the egress bill, and your answer should name it.
- "What's the cost?" For storage-heavy designs, petabytes of object storage cost real money each month, so tiering cold data and deleting what you don't need are design choices, not afterthoughts.
Summary
Back-of-the-envelope estimation turns a vague "large scale" into numbers that decide the architecture. Memorize a few conversions (a day is about 10⁵ seconds, 1 million per day is about 12 per second, 1 Gbps is 125 MB/s), the sizes of common records and media, the latency ladder from memory to cross-region round trips, and rough single-node capacities for app servers, relational databases, Redis and Kafka.
Then follow a consistent method: users to actions, actions to average and peak QPS, the read/write ratio, storage with replication, bandwidth, and node counts with headroom. Round aggressively, state assumptions, compute only what matters, and always end with what the numbers mean: one primary or many shards, a cache or not, a CDN or not, a queue to absorb spikes. The arithmetic is easy. Turning it into the right design decisions is the skill.