Engineering Atlas › System Design Interviews

Quick capacity maths for interviews

14 min read · last reviewed 2026-10-17

Open in the interactive app: practice, quiz, mock interview →

In one minute

How it works

The numbers worth memorising

Latency, roughly, on modern hardware (treat these as orders of magnitude; exact figures vary by generation). The classic table most people memorise dates from about 2012 and still lists a 4 KB SSD random read at 150 microseconds and a California to Netherlands round trip at 150 ms (system-design-primer). The popular "by year" version is extrapolated from growth curves rather than measured: it pins SSD random reads at 16 microseconds from 2014 onward and projects memory and SSD bandwidth forward, so its recent sequential-read figures are far faster than real hardware (Colin Scott). Use the ranges below.

Throughput and capacity anchors (hedged; real limits depend heavily on payload and tuning):

Sizes: an ID or timestamp is 8 bytes; a UUID 16 bytes; an English character in UTF-8 1 byte; a short text post with metadata 0.5 to 1 KB; a compressed photo 200 KB to 2 MB; a minute of 1080p video at streaming bitrates roughly 30 to 60 MB.

Time conversions: a day is 86,400 s, a month about 2.6 million s, a year about 31.5 million s. So 1 million events a day is about 12 per second, 1 billion a day about 12,000 per second.

The estimation template

  1. Users and actions. DAU times actions per user per day gives events per day.
  2. QPS. Events per day divided by 100,000 (or 86,400). Multiply by a read-to-write ratio for reads.
  3. Peak. Multiply by a peak factor: 2 to 3 for smooth global traffic, 5 to 10 or more for spiky events.
  4. Storage. Writes per day times bytes per write times retention days times replication (often 3), plus index and overhead (add 20 to 50 percent).
  5. Bandwidth. QPS times payload size, separately for ingress and egress.
  6. Machines. Peak load divided by per-machine capacity at a target utilisation (often 50 to 70 percent).
  7. Conclusion. One sentence that changes the design: "120 GB a day means about 650 TB over five years with replication, so we need a sharded or object store, not one database node."

What interviewers look for

They want to see you choose round numbers, state assumptions, carry units, and land on a decision. They also notice when candidates over-invest: spending eight minutes estimating everything to three digits leaves no time for the design. Two to four minutes is usually right.

Common mistakes

Down the stack

Layer 1The contract

An estimate promises order-of-magnitude correctness under stated assumptions, not precision. A good one is falsifiable: "about 5,000 writes per second at peak, assuming 50 million DAU and 3 posts per user per day with a peak factor of 3". When an assumption changes, the interviewer can follow the arithmetic and see the new answer. The useful output is a bound that decides architecture: within one node's capacity or not, within one NIC or not, within RAM or not.

Layer 2The mechanism

A few laws turn rates into resources. Little's Law says the average number of requests in flight equals arrival rate times time in system: at 20,000 requests per second and 50 ms per request, about 1,000 are in flight, which sizes thread pools, connection pools and memory for buffers. Utilisation drives queueing delay: in a simple M/M/1 model, time spent waiting in the queue is the service time multiplied by rho / (1 - rho) (M/M/1 queue), so going from 50 percent to 90 percent utilisation multiplies queueing delay by about nine, which is why targets sit around 50 to 70 percent. Storage grows with write amplification: B-tree indexes add a page write per index, LSM compaction rewrites data several times, and replication multiplies everything. Fan-out multiplies load: a feed read that queries 200 followees is 200 backend reads per request. It also multiplies tail latency: if each backend is slow 1 percent of the time, a request that waits for 100 of them is slow 1 - 0.99^100, about 63 percent of the time, so a fan-out estimate should use the backends' p99, not their average.

Layer 3The machine

The latency anchors come from physics and hardware. Light in fibre covers about 200 km per millisecond, so a 6,000 km route has a 60 ms round-trip floor before any routing detours; New York to London is 56 ms on an ideal great-circle path, and real routes are longer (High Performance Browser Networking, ch. 1). A DRAM access around 100 ns reflects row activation and memory controller queues; a cache line is 64 bytes, so streaming memory is far faster than random access. SSD random reads cost tens of microseconds because each read goes through the controller's flash translation layer and a NAND page read. A 4 KB page at 100,000 IOPS is about 400 MB/s, so small random reads saturate IOPS before bandwidth, while large sequential reads saturate bandwidth first. Networks carry about 1,460 bytes of payload per standard Ethernet frame, so a 1 MB response is about 700 packets; at 10 Gbit/s that is roughly 0.8 ms on the wire.

Why it's built this way

Interviews are short and designs depend on scale, so you need a fast way to know which regime you are in. Google's SREs use the same arithmetic in real design reviews: in the workbook's AdWords example, 500,000 queries per second with 2 KB log entries is about 86 TB of logs a day, and at about 200 IOPS per hard disk the naive single-machine design would need about 2,500 disks, which is what forces a distributed design (SRE Workbook, ch. 12). Hardware capabilities change slowly in order of magnitude even as exact numbers shift, so a few anchors stay useful for years. Queues explode near saturation, so capacity plans leave headroom. And because the bottleneck decides the architecture, the skill is finding the one resource that runs out first.

Diagram

flowchart LR
    U["DAU x actions/day"] --> E["Events/day"]
    E -->|"/ 86,400"| Q["Avg write QPS"]
    Q -->|"x read ratio"| R["Avg read QPS"]
    Q -->|"x peak factor"| P["Peak QPS"]
    E -->|"x bytes x days x replicas"| S["Storage"]
    Q -->|"x bytes"| B["Bandwidth"]
    P -->|"/ per-server capacity"| M["Servers"]

Worked example

A photo-sharing service: 100 million DAU, each uploads 0.2 photos a day and views 50 photos a day. Average photo after compression is 500 KB, plus 2 KB of metadata. Keep photos forever (plan for 5 years); 3 copies of metadata, and object storage with its own durability.

Uploads: 100 million times 0.2 is 20 million per day, about 230 per second, peak about 700 per second at a factor of 3. Ingress: 230 times 500 KB is about 115 MB/s average, roughly 1 Gbit/s, and about 3 Gbit/s at peak. Fine for a fleet, and a reason to upload directly to object storage with pre-signed URLs.

Views: 100 million times 50 is 5 billion per day, about 58,000 per second, peak about 175,000 per second. Egress: 58,000 times 500 KB is about 29 GB/s, roughly 230 Gbit/s average. That number is the headline: it must come from a CDN, not origin servers.

Storage: 20 million times 500 KB is 10 TB a day, about 3.65 PB a year, about 18 PB over 5 years before thumbnails. Metadata: 20 million times 2 KB times 3 replicas is 120 GB a day, about 220 TB over 5 years, which needs a sharded metadata store.

Decision: CDN-first serving, object storage with lifecycle tiering for older photos, sharded metadata, and a cache for hot metadata. One estimate changed three design choices.

In the wild

Trade-offs

OptionStrengthsWeaknessesChoose when
Powers of ten roundingFast, low error riskOff by up to about 2xWhiteboard interviews
Precise arithmeticExactSlow, distracts from designCapacity planning docs
Average-based sizingSimpleUnderprovisions for peaksBatch systems with queues
Peak-based sizingSurvives spikesIdle capacity off-peakUser-facing, latency-sensitive paths
Bottleneck-only estimateSaves time, drives decisionsMay miss a second bottleneckMost interviews

Pitfalls in production

Leadership lens

Check yourself

  1. A service gets 500 million requests per day. What is the average QPS, and what peak would you plan for?

    Show answer

    About 5,800 per second on average; plan for roughly 15,000 to 30,000 at a peak factor of 3 to 5 depending on how spiky the traffic is.

  2. Why do you multiply storage by replication and add overhead?

    Show answer

    Each replica stores a full copy, and indexes, metadata and free space add tens of percent, so raw data understates disk by 3 to 4 times.

  3. At 20,000 requests per second with 50 ms latency, how many requests are in flight?

    Show answer

    By Little's Law, 20,000 times 0.05 is 1,000 concurrent requests.

  4. Why size servers for 60 percent utilisation instead of 100 percent?

    Show answer

    Queueing delay grows sharply as utilisation approaches 100 percent, and you need headroom for failures and spikes.

Sources and further study

Primary

Systems docs

Books

Other curricula

Watch

Free resources

Open in the interactive app: practice, quiz, mock interview →