System design fundamentals learning path Level 1 This level · 1 of 6
Easy system-design fundamentals

How do you do a back-of-the-envelope estimate, and how does it change your design?

The 30 second answer

I turn the requirements into a few numbers: average and peak requests per second, read-to-write ratio, storage per year and bandwidth. Then I compare them with what one machine or one database can do, because that tells me which problems are real. If the peak is a few dozen writes a second, one well-indexed database is fine and I don't bring up sharding at all; if it's hundreds of thousands, partitioning becomes the core of the design.

Could you say this in an interview?

Why interviewers want it first. Google's SRE workbook describes Non-Abstract Large System Design (NALSD): start from the problem, attach real numbers, and iterate the design until it fits. They stress that sound reasoning and stated assumptions matter more than the final values; combining many imperfect but reasonable estimates gives a better understanding of the design. The estimate is what turns "we could add Kafka, sharding and a cache" into "we need exactly these parts".

The four numbers I compute.

  • Requests per second (QPS). Daily active users × actions per user per day ÷ 86,400 seconds in a day gives the average. Then apply a peak factor you state as an assumption, because traffic is not flat.
  • Read-to-write ratio. A read-heavy system points to caching, CDNs and read replicas; a write-heavy one points to partitioning and queues.
  • Storage. Writes per day × bytes per record × retention, plus replication copies and indexes.
  • Bandwidth. QPS × average response size, for ingress and egress separately.

An illustrative example (assumed numbers, not benchmarks). A team expense app with 100,000 daily users who each create 5 expenses and view 50 pages a day: 500,000 writes ÷ 86,400 is about 6 writes per second, and 5,000,000 reads is about 58 reads per second on average. Even with a generous peak factor that is a small load for a single PostgreSQL primary with good indexes, so sharding, multi-leader replication and consistent hashing never come up. Say that out loud; it shows judgement. If the same maths gives hundreds of thousands of writes per second, the conversation moves to partitioning and the queue in front of it.

Bring the bottleneck, not just QPS. The SRE workbook's AdWords example shows that the limit can be disk operations, network throughput or round trips between datacenters, not request count. Google's SRE book also warns that modelling capacity as plain "queries per second" is a trap, because requests have very different costs; they measure capacity in terms of the resource a request consumes, such as CPU.

Common mistakes interviewers listen for.

  • Skipping the estimate and designing for "Google scale" by default.
  • Giving numbers without assumptions; always say "assuming 5 actions per user per day".
  • Computing the average but forgetting the peak, or computing storage without replicas, indexes and retention.
  • Precision theatre: rounding to powers of ten is fine. The point is the order of magnitude.
Sources (2)
  1. Google SRE Workbook: Non-Abstract Large System Designsre.google
  2. Google SRE Book: Handling Overloadsre.google
Previous
Next