Learn

GUIDE · ORIGINAL

Estimates that drive decisions

Back-of-envelope numbers worth computing (peak QPS, storage growth, fan-out, working set, bandwidth) and how to skip the ones that change nothing.

A lot of interview estimation is theatre. Someone multiplies daily users by requests per user, divides by 86,400, writes “~11,574 QPS” on the board, and then draws exactly the design they were going to draw anyway. The number changed nothing, so it was wasted time.

An estimate is worth computing only if a plausible answer on one side would make you draw something different from a plausible answer on the other. This guide covers the handful of numbers that regularly cross that line, shows how to get each one in under a minute, and gives you permission to skip the rest.

The test: what would change?

Before you compute anything, say the decision out loud: “If peak writes are under a few thousand per second, one primary database handles it. If they are far above that, I need to shard or buffer.” Now the estimate has a job. You only need enough precision to land on one side of the threshold, which usually means one significant figure and a power of ten.

If you cannot name a decision, skip the number and say so: “Reads per paste do not change the shape here; any reasonable value is cache-friendly.” Interviewers generally respect that more than a page of arithmetic.

A small set of anchors

You do not need a big table memorised. These rough anchors cover most interview decisions:

  • One day is about 105 seconds (86,400). One month is about 2.5 × 106 seconds. One year is about 3 × 107.
  • A single well-indexed relational primary handles thousands of simple writes per second and tens of thousands of point reads from memory. Treat “~5,000 writes/s” as the point where you start asking questions.
  • An in-memory cache node serves on the order of 100,000 simple operations per second.
  • A server has tens to a few hundred GB of RAM. A disk or SSD holds a few TB to tens of TB.
  • A server NIC moves roughly 10 to 25 Gbit/s, which is about 1 to 3 GB/s in practice.
  • Same-datacentre round trip: about half a millisecond. Cross-continent: tens of milliseconds. Across an ocean: 100 ms or more.

These are deliberately round. Hardware varies, and the further reading has measured values if you want them. The point is to know which side of a threshold you are on.

1. Peak QPS, not average

Average QPS is the number people compute. Peak QPS is the one that sizes your system. Traffic follows daily cycles, and many products have spikes on top: a goal in a football match, a sale starting at noon, a push notification sent to everyone at once.

A quick rule: peak is often 2 to 3× the daily average for consumer traffic with a normal daily cycle, and 10× or more for anything event-driven. If the prompt gives a peak, use it. If not, state your multiplier.

Mini example, URL shortener: 10 million new aliases a month is 107 / 2.5 × 106 ≈ 4 writes per second on average, maybe 40 at peak. That number does drive a decision: it says alias creation needs no sharding, no queue, and no clever coordination. Redirects at 100 per alias is about 400 per second on average and a few thousand at peak, which a small cache absorbs. Two numbers, two decisions, done in a minute.

2. Storage growth over the retention period

Compute total stored bytes over the time the data must live: rows per day × bytes per row × days retained × replication factor. Then compare against the capacity of one machine.

  • Under a few hundred GB: one node (with replicas) can hold it. Partitioning is optional.
  • Several TB: you will partition, so pick the partition key now. See partitioning and ordering.
  • Hundreds of TB or more, mostly large immutable objects: put bodies in object storage and keep only metadata in a database.

Mini example, photo sharing: 10 million uploads a day at 2 MB each, stored in three sizes adding roughly 50% more, is about 30 TB a day, or around 10 PB a year before replication. That single estimate decides that photo bytes live in blob storage behind a CDN, that the metadata store only holds ~1 KB rows (about 4 TB a year, fine for a partitioned database), and that the cost conversation is about cold-tier storage, not database choice.

Do not forget the multiplier you control: three replicas or erasure coding at 1.4× is a real design decision, and stating it shows you know bytes on disk are not bytes uploaded.

3. Fan-out multiplication

This is the estimate people most often skip and the one that most often changes the design. Whenever one action causes work for many recipients (followers, group members, subscribers, watchers), multiply.

FIG. 2ORIGINAL SKETCH
post1enqueue2consume3insert x N4AuthorPost APIFan-out queueFan-out workersTimeline cache5k posts/sx200 followers =1M/scelebrity: 50M
Fan-out multiplication on a microblog: 5,000 posts per second become about a million timeline inserts per second, and one celebrity post alone becomes tens of millions.

Mini example, microblog timeline: 5,000 posts per second at peak sounds manageable. Multiply by an average of 200 followers and it becomes a million timeline inserts per second. That alone says fan-out must be asynchronous and the timeline store must be partitioned. Now look at the tail: one account with 50 million followers turns a single post into 50 million inserts. At a million inserts per second across the whole fleet, that one post would take most of a minute and starve everyone else. That number is what justifies the hybrid design in fan-out and real-time delivery, where very large accounts are merged in at read time instead.

The same multiplication shows up in group chat (messages × members), live comments (comments × viewers), and notifications (events × subscribed devices). Always look at both the average and the maximum fan-out; the average sizes the fleet and the maximum shapes the design.

4. Working set vs memory

Total data size is rarely what decides whether a cache works. The working set is: the data touched in a typical window, say an hour or a day. If the hot working set fits in the memory of a few cache nodes, a cache will have a high hit rate and the database sees mostly misses. If it does not, caching helps less than you hope.

Mini example, key-value store: 2 TB of data, but 90% of reads hit 5% of keys. The hot set is about 100 GB, which fits in RAM across two or three nodes. So an in-memory tier in front of disk is worth it, and you should spend your time on what happens when one of those hot keys gets much hotter (see caching and hot keys). If reads were uniform across all 2 TB, you would instead size for disk reads and maybe skip the cache entirely.

For a skewed workload, a useful default to state is “the top 20% of items take most reads”, then compute what 20% costs in RAM. If that number is absurd, say so and pick a smaller hot set.

5. Bandwidth

Bandwidth is the estimate that matters most for media, and almost never for text. Compute bytes per second at peak, convert to bits, and compare with what one server or one region can push.

Mini example, video streaming: 1 million concurrent viewers at an average of 5 Mbit/s is 5 Tbit/s. A single server with a 25 Gbit/s NIC can serve about 5,000 such streams if nothing else limits it. You would need at least 200 servers just for egress, more with headroom, and they need to be close to viewers. That estimate is what makes a CDN with regional caches not optional, and it moves the interesting questions to cache hit rate on popular titles and origin protection for the long tail.

For contrast, a chat message is about 1 KB. Even 100,000 messages per second with an average fan-out of 10 is about 1 GB/s across the whole fleet, which spread over many gateways is unremarkable. Saying “bandwidth is not the constraint here” with that one-line justification is a complete answer.

Numbers to skip

NumberWorth computing whenSkip it when
Average QPSYou need it as a step toward peak, or the system is batch and averages matterYou already have a peak, or both plausible values land under the same threshold
Exact row sizeRows are large or numerous enough that storage crosses a machine boundaryA rough "about 1 KB" puts you comfortably on one side
Server countThe interviewer asks for cost, or the count changes how you coordinate (1 vs 1,000 nodes)It is just total QPS divided by a guess about per-server capacity
Read/write ratioIt decides whether to cache, denormalise, or fan out on writeReads clearly dominate and nothing else hinges on the exact ratio
Latency budgetSeveral sequential hops, a cross-region call, or a tight p99 target are involvedThere is one hop to a nearby store

Server count is the classic waste. “40,000 QPS / 2,000 per server = 20 servers” tells nobody anything they could not already guess, and the per-server figure is invented anyway. Spend the minute on fan-out or working set instead.

How to present estimates

  1. State the decision first. “I want to know whether one primary can take the writes.”
  2. Show the inputs and round aggressively. “10 million a month, about 4 per second, call it 40 at peak.”
  3. Land on a side of the threshold. “Far below a few thousand, so one primary, no sharding needed for writes.”
  4. Write it next to the component it affects. On paper, a small note beside the box (“40 w/s peak”) keeps the number connected to the decision, the way worked approaches on this site pair every estimate with the decision it drives.

And revisit. When a follow-up changes an assumption (10× traffic, a new region, longer retention), redo only the estimates that touch it. If a number crosses a threshold, your sketch should change; if it does not, say so and move on.

TAKE THIS TO YOUR NEXT SKETCH

  • Name the decision before computing a number; if none would change, skip it and say why.
  • Size for peak, not average, and state your peak multiplier.
  • Storage is rows times size times retention times replication; compare it to one machine.
  • Always multiply by fan-out, and check the maximum as well as the average.
  • Caches are decided by the hot working set, not total data size.
  • Bandwidth decides media designs and almost never decides text ones.
  • Round to one significant figure, write units on every line, and put each number next to the box it affects.

PRACTICE WITH THIS

Now sketch one.

OFF-SITE READING · NOT WRITTEN BY US

Further reading

Next: Fan-out and real-time delivery