Why estimate at all
An estimate is only useful if it changes the design. 40 writes per second fits on one database; 400,000 doesn't. 50 GB fits in memory on one machine; 50 TB doesn't. Do the arithmetic out loud, round aggressively, and then say what the number means for the architecture. That last sentence is the part that's being graded.
Numbers worth memorizing
Powers of two and data sizes
| Power of two | Approximately | Unit |
|---|---|---|
| 2¹⁰ | 1 thousand | 1 KB |
| 2²⁰ | 1 million | 1 MB |
| 2³⁰ | 1 billion | 1 GB |
| 2⁴⁰ | 1 trillion | 1 TB |
| 2⁵⁰ | 1 quadrillion | 1 PB |
Time
- Seconds in a day: 86,400 — round to 100,000 for quick math.
- Seconds in a month: about 2.5 million.
- Seconds in a year: about 30 million.
Two conversions cover most interview math: 1 request per second is about 86,400 per day, or 2.6 million per month, and in the other direction, 1 million requests per day is about 12 per second on average.
Latency, roughly
These are approximate orders of magnitude for modern hardware. Exact figures vary by hardware and generation; in an interview, the ratios matter more than the digits.
| Operation | Approximate time |
|---|---|
| L1 cache reference | ~1 ns |
| Main memory reference | ~100 ns |
| Read 1 MB sequentially from memory | tens of µs |
| SSD random read | ~100 µs |
| Read 1 MB sequentially from an SSD | ~1 ms |
| Round trip within a data center | ~0.5 ms |
| Hard disk seek | ~10 ms |
| Read 1 MB sequentially from a hard disk | ~5–10 ms |
| Round trip, US coast to coast | ~60–80 ms |
| Round trip, US to Europe | ~80–150 ms |
What to take from it:
- Memory is roughly 1,000 times faster than an SSD random read. That gap is why caches exist.
- A round trip inside a data center costs about as much as a few SSD reads, so a request that makes dozens of sequential service calls adds up quickly.
- Cross-region calls cost tens to hundreds of milliseconds. Keep them off the request path where you can.
Availability
| 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 |
Components that depend on each other in series multiply: two 99.9% services in series give about 99.8%. Redundant components in parallel do the opposite — two independent 99.9% replicas, either of which can serve, give about 99.9999%, assuming their failures really are independent (they often aren't).
Typical sizes
| Item | Rough size |
|---|---|
| ASCII character | 1 byte |
| 64-bit integer or timestamp | 8 bytes |
| UUID | 16 bytes in binary, 36 as a string |
| Short text post with metadata | ~1 KB |
| Photo, compressed for the web | ~200 KB–1 MB |
| Photo, original from a phone | ~2–5 MB |
| 1 minute of 1080p streaming video | ~30–60 MB |
Rough single-machine capacity
These are rules of thumb only — real numbers depend heavily on the workload — but they're good enough to decide when one machine stops being enough.
| Component | Rough capacity |
|---|---|
| Application server, simple requests | ~1,000–10,000 requests per second |
| Relational database primary, simple queries | a few thousand to tens of thousands of queries per second |
| Redis or Memcached instance | ~100,000 operations per second |
| Storage on one machine | terabytes; petabytes need a distributed store |
The method
- Start from users. Daily active users (DAU) × actions per user per day = actions per day.
- Convert to per second. Divide by about 100,000. That's the average rate.
- Apply a peak factor. Traffic isn't flat; multiply by two to three for the peak, more for spiky products.
- Split reads and writes. Many products are read-heavy, at 10:1 or even 100:1. Estimate each separately, because they scale differently.
- Storage: writes per day × size per write × retention period × replication factor (often 3).
- Bandwidth: requests per second × response size.
- Say what it means. "That's about 2,000 writes per second at peak, which a single database primary can probably handle — but 200,000 reads per second needs a cache."
Worked example: a photo-sharing app
Assumptions: 100 million DAU, 10% of users upload one photo a day, an average photo is 500 KB after compression, each user views 50 photos a day, photos are kept forever, and everything is replicated 3 times.
- Uploads: 100M × 10% = 10M photos per day. 10M ÷ 100,000 ≈ 100 uploads per second on average, about 300 at peak.
- Views: 100M × 50 = 5 billion views per day. 5B ÷ 100,000 = 50,000 views per second on average, about 150,000 at peak.
- Storage per day: 10M × 500 KB = 5 TB, or 15 TB with replication.
- Storage per year: 5 TB × 365 ≈ 1.8 PB of photos, about 5.5 PB replicated.
- Read bandwidth: 50,000 views per second × 500 KB = 25 GB per second on average.
What it means: writes are modest; reads and storage are the problem. Photos belong in object storage, not a database, and 25 GB per second of reads means serving them through a CDN so the origin rarely sees a request. The metadata — who uploaded what, and when — is small enough for a regular database: 10M rows a day × about 1 KB is 10 GB a day.
Worked example: a chat service
Assumptions: 50 million DAU, each sending 40 messages a day, about 100 bytes of text plus 100 bytes of metadata per message, and messages kept for five years.
- Messages: 50M × 40 = 2 billion per day. 2B ÷ 100,000 = 20,000 messages per second on average, about 60,000 at peak.
- Storage per day: 2B × 200 bytes = 400 GB.
- Storage over five years: 400 GB × 365 × 5 ≈ 730 TB, about 2.2 PB with 3× replication.
- Connections: if 20% of DAU are online at peak, that's 10 million concurrent connections. At 50,000–100,000 persistent connections per well-tuned gateway server, that's 100–200 servers just to hold connections.
What it means: 20,000 writes per second is beyond what a single relational primary handles comfortably, so messages go to a horizontally scaled store partitioned by conversation. Petabyte-scale storage over five years suggests moving old messages to cheaper storage tiers. And it's the connection count, not the message volume, that sizes the gateway fleet.
Interview tips
- State assumptions before calculating, and invite correction: "I'll assume 100 million DAU — does that sound right for this product?"
- Round to make the math easy. 86,400 becomes 100,000. Being within two or three times the real answer is fine.
- Write the numbers down as you go, so you and the interviewer can refer back to them.
- Sanity-check the result. If you conclude a chat app needs 10 TB of RAM, check your units.
- Don't overdo it. Two or three key numbers in about five minutes is usually enough. The estimate serves the design; it isn't the design.
For a full worked example that uses these numbers to make design decisions, see design a rate limiter.
