Welcome to the second lesson in our system design course. In our previous session, we focused on the crucial first step of any design interview: distinguishing between functional and non-functional requirements and, most importantly, quantifying them. You learned how to translate vague goals like "the system should be scalable" into concrete targets like "the system must handle 10,000 requests per second."
Today, we'll take that skill and build directly upon it. This lesson is dedicated to mastering back-of-the-envelope estimation. You will learn how to take those quantified requirements and translate them into tangible estimates for traffic, storage, and bandwidth. This is a skill that interviewers value highly in senior candidates because it demonstrates your ability to quickly reason about scale, make informed trade-offs, and scope the hardware and infrastructure needed before you even start drawing boxes and arrows.
By the end of this 60-minute lesson, you'll be able to confidently perform these calculations for any given system, justifying the scale of your design with clear, data-driven reasoning.
The Purpose of Estimation: Good Enough is Perfect
Before we dive into the math, it's essential to understand the goal. Back-of-the-envelope calculations are not about finding the exact, perfect number. They are about getting into the right order of magnitude. Is the system handling hundreds of requests per second, or hundreds of thousands? Does it need to store gigabytes of data, or petabytes?
Answering these questions quickly allows you to make critical early architectural decisions. For example, a low QPS might be handled by a single server, while a high QPS immediately tells you that you'll need load balancers, a fleet of application servers, and possibly a distributed database.
The following images provide a high-level overview of the key metrics and the scope of capacity planning.


The Foundation: Key Numbers and Stated Assumptions
To perform quick calculations, you need a mental library of common latency numbers and data sizes. In an interview, you're expected to know these approximate values. Equally important is your ability to state your assumptions clearly. The interviewer cares less about the specific numbers you choose and more about the logic you use to arrive at them.
Let's review some essential numbers you should commit to memory.
Back To Envelope Or Capacity Estimation - Wisdom - GitBook
This guide from Wisdom Gitbook provides a concise list of the fundamental latency and data size figures you'll need for any estimation task.
Please read the section Essential Numbers to Know. Focus on memorizing the order of magnitude for different operations, such as L1 cache access versus a round trip to another continent. These relative differences are often more important than the exact nanosecond values.
A critical skill in these estimations is the art of aggressive approximation. Your goal is to simplify the math so you can do it in your head or on a whiteboard quickly. For example, the number of seconds in a day is 86,400. For estimation purposes, this is often rounded up to 100,000 (105). This makes division and multiplication with large numbers much more manageable.
The following video does an excellent job of demonstrating this "good enough" approach to calculation.
Capacity Planning and Estimation | System Design for Beginners
This video by Shiran Afergan provides a very practical guide to the mindset and mechanics of capacity estimation in an interview context.
Watch the segment from per day to per second. Pay close attention to how the presenter deliberately rounds numbers to simplify the arithmetic. This technique is key to performing these calculations quickly and confidently under pressure.
A Framework for Estimation
To ensure you cover all bases, it's helpful to follow a structured approach. We will use a five-step framework to break down any estimation problem.
- Gather Requirements & State Assumptions: What are the Daily Active Users (DAU)? What is the read-to-write ratio? What is the average size of the data objects?
- Estimate Traffic (QPS): Calculate the average and peak Queries Per Second (QPS) for both read and write operations.
- Estimate Storage & Bandwidth: Determine the total storage needed over a specific retention period (e.g., 5 years), including replication, and calculate the required network bandwidth for ingress (writes) and egress (reads).
- Estimate Memory (Cache): Apply the 80/20 rule to estimate the amount of cache memory needed to store the "hot" dataset.
- Estimate Servers: Use your peak QPS estimate to determine the number of application servers required.
Now, let's put this framework into practice using the URL shortener example from our last lesson. The following resource provides a complete, worked-out example.
Back To Envelope Or Capacity Estimation - Wisdom - GitBook
This guide walks through the entire 5-step estimation framework and then applies it directly to the problem of designing a URL shortener. This is a perfect demonstration of the theory in practice.
First, read the section The 5-Step Framework to understand the methodology. Then, immediately read the TinyURL example that follows. As you read, trace how the assumptions made in Step 1 (e.g., 100M new URLs/month) are used to derive the final server count in Step 5.
Advanced Techniques and a Second Example
The rounding technique shown earlier is excellent for simplicity. For more complex calculations involving many large numbers, converting to scientific notation can be more robust. The next video demonstrates this technique while working through an estimation for Twitter.
Back-Of-The-Envelope Estimation / Capacity Planning
This video from ByteByteGo, a leading resource in system design, showcases a powerful technique for simplifying calculations and provides a second, more complex example involving multimedia.
First, watch the segment on simplifying calculations. This method of grouping powers of 10 is extremely useful. Then, watch the example of estimating storage for pictures on Twitter. Notice how he breaks the problem down: tweets per day -> percentage with media -> file size -> retention period -> replication.
Sanity-Checking Your Results
After you've done the math, the final step—and one that signals senior-level thinking—is to step back and ask, "Does this number make sense?" If your calculation for a simple photo-sharing app suggests you need more storage than exists in the world, you've likely made a mistake (perhaps mixing up bits and bytes, or mega- and giga-).
Always perform a quick sanity check:
- Order-of-Magnitude Check: Does the result feel reasonable for the type of system you're designing?
- Dimensional Analysis: Did you use consistent units (e.g., bytes, kilobytes, megabytes)? A common error is dividing by 1000 instead of 1024, but far more serious is mixing up bits and bytes, which throws off your estimate by a factor of 8.
- Compare to Known Systems: How do your numbers compare to public data about large-scale systems? For instance, if you know WhatsApp handles ~100 billion messages per day, how does your messaging app's estimate compare?
Practice Exercise
Now it's your turn to apply the framework. Imagine an interviewer asks you to "Design a simple photo-sharing service" (like a basic version of Instagram).
Here are your initial assumptions:
- Users: 50 million Daily Active Users (DAU).
- Writes: 10% of users post one photo per day.
- Reads: The average user views 30 photos per day.
- Data Size: The average photo size is 2 MB.
- Retention: Plan for 5 years of storage.
Your Task: Calculate the following:
- Peak Write QPS and Peak Read QPS. (Assume peak traffic is 2x the average).
- Total storage required for 5 years. (Assume a replication factor of 3).
- Peak egress (read) bandwidth.
Take 10 minutes to work through the calculations on paper. Be sure to write down your steps.
Click to see a sample solution
Here is one way to solve the problem:
1. QPS Estimation
- Total Daily Writes: 50M DAU * 10% * 1 photo/user = 5 million writes/day.
- Total Daily Reads: 50M DAU * 30 photos/user = 1,500 million (1.5 billion) reads/day.
- Average Write QPS: 5M writes / 100,000 seconds ≈ 50 QPS.
- Average Read QPS: 1,500M reads / 100,000 seconds = 15,000 QPS.
- Peak Write QPS: 50 QPS * 2 = 100 QPS.
- Peak Read QPS: 15,000 QPS * 2 = 30,000 QPS.
Note: The read-to-write ratio is 1.5B reads / 5M writes = 300:1, confirming this is a very read-heavy system.
2. Storage Estimation
- Data generated per day: 5M writes/day * 2 MB/photo = 10 million MB/day = 10 TB/day.
- Days in 5 years: 5 years * 365 days/year ≈ 1825 days. Let's round to ~2000 days for simplicity.
- Total raw storage in 5 years: 10 TB/day * 2000 days = 20,000 TB = 20 PB (Petabytes).
- Total storage with 3x replication: 20 PB * 3 = 60 PB.
3. Bandwidth Estimation
- We only need to calculate egress (read) bandwidth, which is driven by peak read traffic.
- Peak Egress Bandwidth: Peak Read QPS * Average Photo Size
- 30,000 requests/sec * 2 MB/request = 60,000 MB/sec = 60 GB/s.
Sanity Check: 60 GB/s is a massive amount of data, equivalent to 480 Gigabits per second (Gbps). This immediately tells you that serving this traffic from a single location is not feasible and that a Content Delivery Network (CDN) will be an absolute requirement in your design to handle this load globally.
Conclusion
In this lesson, you've learned how to perform one of the most fundamental tasks in system design: back-of-the-envelope estimation. This process is your first step in transforming abstract requirements into a concrete plan.
Key takeaways from today include:
- The goal is order-of-magnitude correctness, not perfect precision.
- Use a structured framework: Start with assumptions, then estimate traffic (QPS), storage, and bandwidth.
- Memorize key numbers for latency and data sizes, and simplify your math by rounding aggressively.
- Always state your assumptions clearly. This is more important than the numbers themselves.
- Sanity-check your results to ensure they are reasonable.
The numbers you've just calculated are not just an academic exercise. They are the direct inputs for our next topic. The peak QPS tells you how many servers you need. The total storage dictates your database and storage layer choices. The bandwidth requirements justify the need for components like CDNs.
In our next lesson, we will use these very estimates to sketch a high-level architecture diagram, bringing us one step closer to a complete system design.