Back-of-Envelope Estimation

Turn a user count into QPS, storage and bandwidth in five minutes, with numbers you memorized once.

Powers of two Latency numbers QPS Storage Bandwidth
๐Ÿงฎ

Why Estimate at All

Estimation is how you find the bottleneck before you draw around it. A number tells you whether the data fits in memory or needs a hundred machines, whether reads or writes dominate, whether the payload is the story or the request count is. Skip it and you're designing blind, and the interviewer knows it.

The goal is not precision. It's the right order of magnitude, fast, so the rest of your design rests on something real. "It should scale" is not an answer. "That's 4 GB/s of egress, so this is a CDN problem, not a database problem" is.

๐Ÿ’ก
You only need three outputs from this stage: peak QPS, total storage, and peak bandwidth. Everything you compute is in service of one of those three. Say each number out loud with its unit, then move on.
๐Ÿ”ข

Numbers to Memorize

You can't derive these in the room, so carry them in. Four small tables cover almost every question. Round everything; the point is the ratio between numbers, not the numbers themselves.

Powers of two โ†’ data sizes Sizing
Powerโ‰ˆ ValueName
2^101 thousandKilobyte (KB)
2^201 millionMegabyte (MB)
2^301 billionGigabyte (GB)
2^401 trillionTerabyte (TB)
2^501 quadrillionPetabyte (PB)
Latency numbers, rounded Every engineer should know
OperationTimeWhat it tells you
L1 cache reference1 nsThe floor. Everything is measured against this.
Main memory reference100 ns~100ร— slower than L1, still effectively free.
Read 1 MB from memory250 ยตsRAM is fast but not infinite; big scans still cost.
SSD random read100 ยตs~1000ร— slower than memory. Cache to avoid it.
Read 1 MB from SSD1 ms~4ร— the memory read. SSD is closer to RAM than to disk.
Datacenter round trip0.5 msA network hop inside one region is cheap.
Disk seek (rotational)10 ms~100,000ร— a memory reference. Random disk I/O is death.
Read 1 MB from disk20 msSequential disk is tolerable; random is not.
Round trip US โ†” Europe150 msCross-region on the request path is poison.
Throughput rules of thumb Capacity
ResourceRough ceiling
App server (simple req)~10K QPS
SSD~100K IOPS, ~1 GB/s
DB primary (writes)~a few K/s
Redis / cache node~100K ops/s
1 Gbps link~125 MB/s
10 Gbps link~1.25 GB/s
Time, rounded The key trick
IntervalSeconds
Per day86,400 โ†’ 100K
Per month~2.5 million
Per year~30 million

Rounding a day to 105 seconds is the single most useful move in this whole page. It turns "requests per day รท seconds per day" into a clean shift of the decimal point.

โ„น๏ธ
The exact values drift with hardware, and nobody grades you on 100 ยตs vs 150 ยตs. What you're being tested on is the ratios: memory is ~1000ร— faster than SSD, SSD is ~10ร— faster than disk seeks, a cross-region hop is ~300ร— a local one. Those gaps decide architecture.
โšก

Estimating QPS

The derivation is always the same four steps: start from daily active users, multiply by how many times each one hits the feature per day, divide by seconds per day for the average, then multiply by a peak factor because traffic is never flat.

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  100M    โ”‚  ร—  โ”‚  5 requests  โ”‚  =  โ”‚  500M reqs  โ”‚  รท  โ”‚ 100K sec โ”‚  =  โ”‚ 5K QPS   โ”‚
  โ”‚   DAU    โ”‚     โ”‚ per user/day โ”‚     โ”‚  per day    โ”‚     โ”‚ per day  โ”‚     โ”‚ average  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
                                                                                  โ”‚
                                            peak factor ร—2 to ร—5 (here ร—3)        โ”‚
                                                                                  โ–ผ
                                                                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                                                            โ”‚ 15K QPS  โ”‚
                                                                            โ”‚   peak   โ”‚
                                                                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Worked example: a social feed Step by step
  • DAU: 100M users open the app on a given day.
  • Actions per user: each refreshes the feed ~5 times โ†’ 500M feed reads/day.
  • Average QPS: 500M รท 100K seconds = 5,000 QPS.
  • Peak QPS: traffic clusters around evenings and events, so ร—3 โ†’ 15,000 QPS.
  • Sanity check: one app server handles ~10K simple QPS, so this is a handful of machines plus headroom, not a heroic system. That feels right for a read of a cached feed.
โš ๏ธ
The peak multiplier is where designs quietly break. Average load provisions nothing useful, because your system dies at the peak, not the mean. Pick 2ร— for smooth global traffic, 5ร— or more for spiky, event-driven, or timezone-clustered load. State which and why.
๐Ÿ’ก
Separate read QPS from write QPS from the start. A 100:1 read/write ratio is the tell that this is a caching and read-replica problem (Caching), while a write-dominated number pushes you toward sharding and queues (Sharding). The ratio shapes the whole design, so surface it here (Design Process).
๐Ÿ’พ

Estimating Storage

Storage is a multiplication: how big each object is, times how many you write per day, times how long you keep them, times how many copies you hold. The trap is treating all data as one number. Split it: small metadata scales differently from large payloads, and one of them usually dwarfs the other.

  writes/day        object size        retention           replication
  200M tweets   ร—   500 bytes     ร—    365 days      ร—      3 copies
       โ”‚                โ”‚                  โ”‚                    โ”‚
       โ””โ”€โ”€โ”€โ”€ 100 GB/day โ”˜                  โ”‚                    โ”‚
                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 36 TB/year โ”€โ”€โ”˜                    โ”‚
                                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ~110 TB stored โ”˜
Worked example: tweets for a year Metadata vs payload

Text and metadata. 100M users post ~2 tweets/day โ†’ 200M tweets/day. Text plus IDs, timestamps and user reference is ~500 bytes.

  • Per day: 200M ร— 500 B = 100 GB/day.
  • Per year: 100 GB ร— 365 โ‰ˆ 36 TB/year.
  • With 3ร— replication (Replication): โ‰ˆ 110 TB. Fits on a modest cluster.

Media. Say 10% of tweets carry a 200 KB image โ†’ 20M images/day.

  • Per day: 20M ร— 200 KB = 4 TB/day.
  • Per year: โ‰ˆ 1.5 PB/year, and โ‰ˆ 4.4 PB replicated.

The image bytes are 40ร— the text bytes. This design is a blob-storage-and-CDN problem wearing a database costume. Say that out loud, then keep media out of the database entirely (Specialized Stores).

๐Ÿ’ก
This is the moment to name the real bottleneck. When payload dwarfs metadata, the interviewer is watching for whether you split them: metadata in a database, payload in object storage with a pointer, delivery through a CDN. Candidates who store image bytes in Postgres lose the thread here.
๐Ÿ“ถ

Bandwidth & Memory

Bandwidth falls straight out of the storage math: a per-day byte total divided by seconds per day is a byte rate. Split it two ways. Ingress is what you take in (roughly your write volume). Egress is what you serve out, and on a read-heavy system it's larger by the read/write ratio.

Bandwidth from the tweet example Ingress vs egress
FlowRateConsequence
Text ingress1 MB/s100 GB/day รท 100K s. Trivial.
Media ingress40 MB/s4 TB/day รท 100K s. One fat link handles it.
Media egress (100:1 reads)4 GB/s40 MB/s ร— 100. No origin serves this; you need a CDN.
โ„น๏ธ
Egress is where cost lives. Reads outnumber writes, payloads leave more often than they arrive, and cross-region or internet egress is billed. The 4 GB/s number is the argument for pushing bytes to the edge and never touching origin on a cache hit (Networking Basics).
Cache sizing with the 80/20 rule Memory

You rarely cache everything. Roughly 20% of the data serves 80% of the reads: recent tweets, popular items, active users. Size the cache to the hot set, not the corpus.

  • Daily text written: ~100 GB. The hot working set that reads actually touch is a fraction of that.
  • Cache the hot 20% โ‰ˆ 20 GB, which fits in the RAM of a single cache node with room to spare.
  • Lesson: for small-payload, read-heavy systems, the working set fits in memory. That's the same insight that makes a URL shortener cheap, and it's why caching is the highest-leverage move you have.
โœ‚๏ธ

Rounding Discipline

How to keep the math cheap and honest Discipline
  • Round to one significant figure. 86,400 becomes 100K, 365 becomes 400 (or just leave the year as ~30M seconds). You're finding the order of magnitude, not balancing a ledger.
  • Keep units on every line. Bytes/day, GB, QPS, MB/s. Half of all estimation errors are a lost factor of 1000 from dropping a unit. The unit is the error check.
  • Carry powers of ten, not commas. 500M is 5 ร— 108; 100K seconds is 105. Dividing is subtracting exponents: 108 รท 105 = 103 = a few thousand QPS.
  • Sanity-check against a known ceiling. 15K peak QPS against ~10K per server means a few machines. 4 GB/s egress against a 1.25 GB/s link means it cannot be one origin. The check catches the dropped-1000 error instantly.
  • Stop when the number decides the design. Once you know it's "TB not PB" or "CDN not database," the estimate has done its job. More digits are theater.
โš ๏ธ
Precision is a trap that eats interview minutes. Nobody wants 4.38 PB; they want "single-digit petabytes, so object storage, tiered, with lifecycle expiry." Spend the time you saved on the design, which is what's actually being graded.
๐Ÿ“‹

Quick Reference

Memorized numbers Carry these in
QuantityValueNote
Seconds/day~100K (10^5)The workhorse. Round 86,400 up.
Seconds/year~30MFor retention math.
KB / MB / GB / TB / PB10^3 โ€ฆ 10^15Each step is ร—1000.
Memory reference100 nsEffectively free.
SSD random read100 ยตs~1000ร— memory.
Disk seek10 msAvoid random disk I/O.
Same-region round trip0.5 msCheap.
Cross-region round trip~150 msNever sync on the request path.
App server~10K QPSDivide peak QPS by this for fleet size.
1 / 10 Gbps link125 / 1250 MB/sCheck egress against this.
The standard derivations Formulas
TargetFormulaThen
Average QPSDAU ร— req/user รท 100Kร— 2โ€“5 for peak
Fleet sizepeak QPS รท ~10K+ headroom & redundancy
Storage/yearobj size ร— writes/day ร— 365ร— ~3 for replicas
Ingressbytes written/day รท 100Kโ‰ˆ write bandwidth
Egressingress ร— read/write ratio> link capacity โ†’ CDN
Cache sizehot-set bytes (~20% of daily)fit in RAM if you can