A standalone reference for the eight-part How Backend Systems Scale series.
In a system design interview, the first useful number is usually an approximation you can explain. You want to discover whether a system needs tens, thousands, or millions of operations per second before arguing about individual machines.
This is the calculation method used throughout How Backend Systems Scale. Keep the units visible and say which numbers you rounded.
What you’ll learn
- A repeatable workflow for rough estimates.
- Common time, byte, and rate conversions.
- How to check whether an answer makes sense.
The workflow: assumptions, powers, units, check
- Name the operation: users, requests, uploads, and database writes are different quantities.
- Write the inputs with units:
10^6 uploads/day × 2 × 10^6 bytes/upload. - Round deliberately: keep one significant digit, or a small coefficient when it matters.
- Calculate coefficients and powers separately: multiply powers by adding exponents; divide by subtracting them.
- Cancel units: the example above leaves bytes per day.
- Separate average from peak: choose and label a peak assumption.
- Add omitted work explicitly: indexes, copies, backups, retries, or thumbnails.
- Check the result: multiply a rate by the time window to recover the original volume.
Aha moment: Rounding is useful because it makes the structure visible. It is not permission to drop a factor of 1,000 or confuse bits with bytes.
Time conversions worth remembering
| Interval | Useful value | Rough interview value |
|---|---|---|
| Minute | 60 seconds | 6 × 10^1 seconds |
| Hour | 3,600 seconds | 3.6 × 10^3 seconds |
| Day | 86,400 seconds | 10^5 seconds |
| 30-day month | 2,592,000 seconds | 2.6 × 10^6 seconds |
| 365-day year | 31,536,000 seconds | 3 × 10^7 seconds |
Dividing by 10^5 instead of 86,400 underestimates the true daily average by about 14%. That is often fine for an early order-of-magnitude estimate. Use 86,400 when tightening the answer.
Do not round a month to 10^6 seconds silently: that would overestimate a monthly average rate by about 2.6 times.
Powers and storage units
| Quantity | Decimal notation | Useful meaning |
|---|---|---|
| Thousand | 10^3 | 1,000 |
| Million | 10^6 | 1,000,000 |
| Billion | 10^9 | 1,000,000,000 |
| KB, MB, GB, TB | 10^3, 10^6, 10^9, 10^12 bytes | Decimal units used in this sheet |
| KiB, MiB, GiB, TiB | 2^10, 2^20, 2^30, 2^40 bytes | Binary units; close to, but different from, decimal units |
| Byte | 8 bits | Multiply bytes by eight for bits |
| Millisecond | 10^-3 seconds | 1,000 ms per second |
| Microsecond | 10^-6 seconds | 1,000 microseconds per millisecond |
For quick mental math, 2^10 ≈ 10^3. Name the convention instead of mixing GB and GiB halfway through.
Daily volume to average requests per second
Using 10^5 seconds per day:
| Daily requests | Rough average requests/second | Using 86,400 seconds, approximately |
|---|---|---|
10^5 | 1 | 1.2 |
10^6 | 10 | 12 |
10^7 | 100 | 116 |
10^8 | 1,000 | 1,157 |
10^9 | 10,000 | 11,574 |
These are request counts, not user counts. For daily active users:
requests/day = active users/day × requests/user/day
One million users making 20 requests each produce 2 × 10^7 requests per day, roughly 200 requests per second by the rounded method.
Average is not peak
peak request rate = average request rate × assumed peak factor
If average demand is 10^2 requests per second and you assume a factor of ten, peak demand is 10^3 per second.
- Ten is an illustrative assumption, not a universal rule.
- Ask about time zones, scheduled events, and launches.
- Use measured traffic when available.
- State how long the peak lasts; a worker queue may absorb a brief burst but not hours of excess demand.
A worked photo-app estimate
Assume:
10^6daily active users.- Each views 20 photos per day.
- Each delivered photo averages
2 × 10^5bytes, about 200 KB. 10^5uploads per day.- Each uploaded original averages
2 × 10^6bytes, about 2 MB.
Read requests:
10^6 users/day × 20 views/user = 2 × 10^7 views/day
2 × 10^7 / 10^5 seconds ≈ 2 × 10^2 views/second
Delivered bytes:
2 × 10^7 views/day × 2 × 10^5 bytes/view
= 4 × 10^12 bytes/day ≈ 4 TB/day
Average delivered bandwidth:
4 × 10^12 bytes/day / 10^5 seconds/day
= 4 × 10^7 bytes/second
4 × 10^7 × 8 = 3.2 × 10^8 bits/second ≈ 320 Mbps
Stored originals:
10^5 uploads/day × 2 × 10^6 bytes/upload
= 2 × 10^11 bytes/day ≈ 200 GB/day
30 days × 200 GB/day ≈ 6 TB
Views create transfer. Uploads create new stored data. Do not multiply all views by the original upload size unless viewers actually download that representation.
Formula card
| Estimate | Formula | Important condition |
|---|---|---|
| Request rate | requests / seconds | State average or peak |
| Raw storage | records/day × bytes/record × retention days | Excludes extra structures and copies |
| Total copies | single-copy size × copy count | Three total copies means multiply by three |
| Bandwidth | requests/second × bytes/response × 8 | Result is bits/second; add overhead separately |
| Cache memory | active entries × bytes/entry | Include keys and data-structure overhead |
| Database reads after cache | reads/second × miss fraction | Add refreshes and other database work |
| Average in-flight work | arrival rate × average time in system | Stable workload and matching boundaries |
| Ideal worker count | peak jobs/second / jobs/second/worker | Round up, then add headroom and failure capacity |
| Backlog growth | arrival rate − completion rate | When arrivals exceed completions |
| Catch-up time | backlog / spare completion rate | Spare rate is completion capacity minus continuing arrivals |
For 10^4 reads per second at 99% hits, misses are 10^4 × 10^-2 = 10^2 per second. At zero hits during a cold start, that can become all 10^4 reads per second.
Short-code capacity and collisions
62^6 ≈ 5.7 × 10^10possible six-character Base62 strings.- A unique counter encoded as Base62 uses the space differently from random draws.
- For random draws into
Mpossibilities, a small collision probability is approximatelyn(n − 1) / (2M). - Once that expression is no longer small, do not present it as a valid probability. Probabilities cannot exceed one.
See unique IDs for the practical trade-offs and collision handling.
Numbers you should measure instead of memorize
Avoid treating these as universal constants:
- Requests per second per server.
- Database query duration.
- Cache hit rate.
- Compression ratio.
- Cross-region round-trip time.
- Disk throughput under your workload.
Hardware, payloads, access patterns, configuration, and geography change them. In an interview, name a plausible assumption and explain how you would validate it.
Try it
A job service receives 3 × 10^6 jobs per day. Each job stores 2 × 10^3 bytes of metadata for 30 days. Assume a peak factor of five.
- Rough average:
(3 × 10^6) / 10^5 = 30jobs per second. - Assumed peak:
30 × 5 = 150jobs per second. - Raw metadata:
3 × 10^6 × 2 × 10^3 × 30 = 1.8 × 10^11bytes, about 180 GB. - Three total copies: about 540 GB before indexes, backups, and operational spare space.
More interview shortcuts
Quick conversions from counts to bits and characters
For N distinct values starting at zero, use ceil(log2(N)) bits. For an alphabet of A symbols, use ceil(log_A(N)) fixed-length characters.
| Capacity | Useful binary estimate |
|---|---|
| About one thousand | 2^10, about 10 bits |
| About one million | 2^20, about 20 bits |
| About one billion | 2^30, about 30 bits |
| About ten billion | Between 2^33 and 2^34; use 34 bits |
| Six Base62 characters | 62^6 ≈ 5.7 × 10^10 combinations |
One Base62 character carries about log2(62) ≈ 5.95 bits of choice. This is code-space capacity, not a random-collision guarantee.
Three years is roughly 3 × 3 × 10^7 ≈ 10^8 seconds. At 100 new records per second, three-year retention therefore holds about 10^2 × 10^8 = 10^10 records. At 2 KB each, that is roughly 20 TB before overhead and extra copies.
From retained data to actual nodes
| Estimate | Formula | Check before trusting it |
|---|---|---|
| Working-set memory | retained records × cached fraction × bytes per entry | Include keys, metadata, and realistic popularity |
| Storage-driven shard count | ceil(required single-copy bytes / usable bytes per shard) | Usable capacity is smaller than advertised capacity |
| Total nodes for replicated shards | shard count × total copies per shard | Define whether the primary is included |
| Load-driven instance count | ceil(peak rate / measured useful rate per instance) | Use a test that meets latency and error goals |
| One-failure application provision | required healthy instances + 1 | Assumes that one lost instance is the intended failure model |
| Time-based unavailability allowance | window seconds × bad fraction | Not interchangeable with a request-based error budget |
For a 20 GB working set, 8 GB usable per cache node, and three total copies per shard:
shards = ceil(20 / 8) = 3
cache nodes = 3 × 3 = 9
That count satisfies only the stated memory constraint. Check throughput, skew, network traffic, and failure behavior independently. Do not assume all replicas accept writes or contribute interchangeable capacity.
Availability memory aid
For a 30-day month, a time-based objective permits approximately:
- 99%: 7 hours 12 minutes unavailable.
- 99.9%: 43 minutes 12 seconds unavailable.
- 99.99%: 4 minutes 19 seconds unavailable.
- 99.999%: 26 seconds unavailable.
For a request-based objective, calculate the permitted number of bad requests instead.
Apply the method, then check the assumptions
- Keep read and write rates separate; one write can trigger several storage operations.
- Estimate application, cache, database, and delivery traffic separately.
- A 20% cache working set does not imply any particular hit rate without a workload model.
- A cold cache can move the full read load to storage.
- Extra threads can overlap waiting; they do not multiply a core’s CPU capacity.
- A signal’s travel time is roughly distance divided by propagation speed; it is a lower-bound estimate, not a measured Internet round trip.
For the full walkthrough, see capacity and SLOs.
What to remember
- Keep units beside numbers until they cancel.
- Separate average, peak, storage, and transfer.
- Label assumptions and return to measurements before making real capacity commitments.