The whole course ▾
System Design · Lesson 2 of 39 · Week 1
The numbers every engineer should know
QuickBite is growing fast. Today: the numbers every engineer must know to prove a system will work before writing a single line of code.
Got a doubt? Ask in the comments under the video.Subscribe
QuickBite expects one million orders a day: what that means a second, and on disk.
QuickBite is the food delivery app we grow through the course, from one server to millions of orders.
Requirement clarificationWhen guessing is not enough
In lesson one, we saw what happens when a single customer opens QuickBite. A request travels to the server, hits the database, and comes back. It feels instant. But what happens when QuickBite becomes a success? Imagine we now have one million orders every single day. Is our database too small? Is our network too slow? If an interviewer asks you if a design is 'fast enough', they aren't looking for a 'yes' or 'no'. They want to see you use a mental ruler to measure the system. Today, we're building that ruler. Without these numbers, you're just guessing, and in a system design interview, guessing is the fastest way to fail.
Here is QuickBite as we left it. One million orders a day sounds like a lot, but what does it actually mean for our hardware? If every order takes two seconds to process, our server will melt. If every order takes ten megabytes of disk space, our database will be full by next week. To design a system that survives, we need to understand the physical limits of our computers. We need to know how long things take and how much they hold. Let's start with the most important number in any system: latency.
FoundationsThe speed of light and silicon
Latency is simply the time it takes for a single message to travel from point A to point B. In a computer, these times are so small they feel like zero, but they add up quickly.
Think of these on a human scale to see the difference. If reading from your L1 cache—the memory right inside your CPU—takes one second, then reading from main memory takes about three minutes. That's a nice coffee break. But reading from an SSD? That's like waiting four days. And sending a packet from California to the Netherlands and back? That's a round trip of 150 milliseconds. On our human scale, that is like waiting nearly five years. This is why we care about where our data lives. Moving data from a disk to memory makes it a thousand times faster. Moving it from another continent to the local data center makes it a million times faster. When you design QuickBite, you'll always be fighting these physical limits.
Metrics and MonitoringThroughput and Percentiles
Now, speed isn't everything. We also need to know how much work we can do at once. This is where engineers often get confused between latency and throughput.
Imagine a highway. Latency is how long it takes one car to drive from the restaurant to the customer. Throughput is how many cars can pass a certain point every second. You can have great latency but terrible throughput if the road only has one lane. In the interview, if you say the system is 'slow', the interviewer will ask: 'Is it high latency or low throughput?' They are different problems with different fixes. But wait, not every request takes the same amount of time. Some customers have huge orders; some have slow internet. If we say the average latency is 100 milliseconds, that sounds good, right? But averages are dangerous. They hide the truth.
We use percentiles instead. p50, or the median, means half of our customers see a speed of 100 milliseconds or better. That's the typical experience. But p99 is the number that keeps senior engineers awake. It means the slowest one percent of requests take two seconds or more. If QuickBite has a million orders, p99 means ten thousand people every day are having a terrible, slow experience. They are the ones who will delete the app. In an interview, always ask about the p99. It shows you care about the users who are actually having a hard time, not just the 'average' user who doesn't exist.
Non-functional requirementsThe cost of the Nines
Next is reliability. We measure this in 'nines' of availability. It sounds like marketing talk, but the math is brutal.
If QuickBite has two nines of availability, it can be down for nearly four days a year. For a food delivery app, that's a disaster. Most professional systems aim for three nines—about nine hours of downtime a year. That allows for the occasional crash or a slow update. Four nines is very hard; it means you only have 52 minutes for the entire year to fix every single problem. And five nines? That is 'telecom grade'. It means you almost never touch the system, and everything is perfectly automated. In your interview, don't just say 'high availability'. Say 'I'm aiming for three nines', and then explain how you'll handle those eight hours of failure.
Back-of-the-envelope estimationThe QuickBite Math
Now let's put it all together for QuickBite. We have one million orders a day. Let's calculate what that means for our servers right now.
Here is the most useful shortcut you will ever learn: a day has about 100,000 seconds. It's actually 86,400, but in an interview, use 100,000. It makes the math easy and interviewers love the speed. So, one million orders divided by 100,000 seconds is 10 orders per second on average. But people don't eat at 3 AM. They eat at lunch. We assume the peak traffic is about three times the average. So our system needs to handle 30 orders a second. That's easy for one server! But what about storage? If one order is one kilobyte of data, a million orders is one gigabyte a day. In a year, that's 365 gigabytes. Suddenly, we can see the future. We know that one database can hold a year's worth of data easily, but in five years, we might need to think about splitting it up.
Interview wrap-upIn the interview
When you're in the room, these numbers are your best friend. They turn a vague conversation into a real engineering discussion.
Say this clearly at the start of your design. It sets the scale. If you don't do this, the interviewer might be thinking of a tiny app while you're designing for Google, or vice versa. Showing you know the difference between average and peak traffic proves you've seen real systems under load.
Avoid these traps. Don't waste five minutes trying to multiply 86,400 by something. Round it to 100,000. Never design for the average; always design for the peak. And if you suggest a database lookup, remember that disk is slow—ask yourself if it should be in memory instead. These numbers aren't just for tests; they are how we decide which tools to use.
Quick check
If your average traffic is 1,000 requests per second, what should you design your system to handle?
Show the answer
At least 3,000 requests per second to account for peak usage.
Three things to take away. Memory is fast, disk is slow, and the network is the slowest of all. Use the 100,000-second shortcut for daily math. And always look at the p99, because that's where your real performance problems are hiding.
Lessons on weekdays, the week's revision on Saturday, a mock interview on Sunday.