DEV Community

Cover image for How to Ace Back-of-the-Envelope Estimation in System Design Interviews πŸš€
Tech Paths
Tech Paths

Posted on • Edited on • Originally published at techpaths.dev

How to Ace Back-of-the-Envelope Estimation in System Design Interviews πŸš€

Picture this: You're in a System Design interview. The interviewer asks, "Design Twitter. How much storage and bandwidth will we need for 5 years?" Your mind goes blank. Your palms sweat.

But here is the secret: Interviewers don't care about exact precision. They care about your engineering judgment, your core assumptions, and whether you can reason about scale under pressure.

This process is called Back-of-the-Envelope Estimationβ€”making quick, approximate calculations to understand a system's scale in under 3 minutes. Here is the ultimate cheat sheet to master it.


πŸ”’ The Cheat Sheet Metrics

You can't do math if you don't know the baseline numbers. Memorize these:

1. Powers of 2 (Data Units)

  • $2^{10}$ = 1 Thousand = 1 KB
  • $2^{20}$ = 1 Million = 1 MB
  • $2^{30}$ = 1 Billion = 1 GB
  • $2^{40}$ = 1 Trillion = 1 TB
  • $2^{50}$ = 1 Quadrillion = 1 PB

2. Latency Numbers to Remember

  • RAM Read: ~100 ns
  • SSD Read: ~100 Β΅s
  • Network Round Trip (Same DC): ~500 Β΅s
  • HDD (Disk) Read: ~10 ms
  • Network Round Trip (Cross-Region): ~150 ms

3. The High Availability "Nines"

  • 99% (Two Nines): ~3.6 days downtime/year
  • 99.9% (Three Nines): ~8.7 hours downtime/year
  • 99.99% (Four Nines): ~52 minutes downtime/year

πŸ—ΊοΈ The 4-Step Estimation Framework

Never guess randomly. Follow this sequential pipeline to calculate scale methodically:

 +---------------+       +-----------+       +---------------+       +------------------+
 | Traffic (RPS) | ----> |  Storage  | ----> |   Bandwidth   | ----> |  Servers Needed  |
 +---------------+       +-----------+       +---------------+       +------------------+

Enter fullscreen mode Exit fullscreen mode

Step 1: Traffic Estimation 🚦

  • Formula: RPS = (DAU Γ— Requests per user per day) / 86,400
  • Pro-Tip: Round 86,400 seconds in a day to 100,000 for fast interview math!
  • Example (300M DAU, 1 write/day): $300\text{M} / 100,000 = \mathbf{3,000\text{ Write RPS}}$.

Step 2: Storage Estimation πŸ’Ύ

  • Formula: Storage = Items per day Γ— Average Item Size Γ— Retention Period
  • Example: 3,000 writes/sec $\approx$ 300M items/day. At 1 KB per item, that's 300 GB/day. Over 5 years ($300\text{ GB} \times 365 \times 5$), you'll need roughly 547 TB.

Step 3: Bandwidth Estimation 🌐

  • Formula: Bandwidth = RPS Γ— Average Payload Size
  • Example: If your system has 300,000 Read RPS and a 1 KB payload, you need 300 MB/s throughput. This immediately tells you that you must use a CDN to avoid crashing your core database.

Step 4: Server Estimation πŸ–₯️

  • Formula: Servers = Total RPS / RPS a single server can handle
  • Assumption: A standard commodity web server can safely handle between 1,000 to 10,000 RPS depending on workload.
  • Example: For 300,000 Read RPS at 10,000 RPS/server, you need 30 base servers. Multiply by a 3x safety factor for traffic spikes $\approx$ 90 servers.

πŸš€ Deep Dive: Real-World Interview Scenarios

How does this work for different system architectures? It depends entirely on what you are building.

I have written down the full, step-by-step mathematical breakdowns for the most common system design interview questions on my blog. Dive deep into the specific calculations here:


🎯 Key Takeaways

  1. Round aggressively. Nobody cares about the difference between 86,400 and 100,000 during an estimation drill.
  2. State your assumptions clearly. The interviewer wants to see how you think, not if you memorized the exact size of Twitter's database.
  3. Sanity check your numbers. If your final storage calculation says 500 PB for a simple text-based app, take a breath and check your decimals.

πŸ› οΈ Want to master the full framework?

For the absolute complete guideβ€”including data sizing charts for data types (UUIDs, ASCII vs Unicode) and availability tablesβ€”read the original deep dive on TechPaths: Back-of-the-Envelope Estimation.

How do you handle napkin math during interviews? Let's discuss in the comments below! πŸ‘‡

Top comments (0)