Back-of-envelope estimation: QPS, storage, bandwidth
Estimation is how you find out what kind of problem you have. A thousand requests a second and a million requests a second need different designs, and you can tell which one you're facing with a few lines of arithmetic. What interviewers listen for is whether your numbers drive your decisions.
Planning food for a wedding
Imagine you're catering a wedding. You don't count grains of rice; instead you ask how many guests are coming, how many plates each will eat and how much each plate weighs. With 300 guests at about 2 plates each, that's 300 × 2 = 600 plates, which is roughly 120 kg of food and means two vans rather than one car.
Nobody cares whether it's 117 kg or 124 kg, because what matters is that the answer tells you to book two vans. Estimating a system works the same way, and each part of the wedding sum has a match:
- guests → users
- plates per guest → requests per user
- weight per plate → bytes per request
- vans → servers, storage and bandwidth