Back-of-the-Envelope Estimation in a System Design Interview: Only Do the Math That Picks a Design

Back-of-the-envelope estimation in a system design interview should take one to three minutes. Spend them on the number that picks between two designs. Skip the rest. Many candidates open with a ritual. They work out QPS, storage per year and bandwidth, then say “so it’s a lot.” The interviewer learns you can multiply. Nothing on the board changes. A better habit has three parts. First, tell the interviewer you’ll estimate when a decision needs it. Second, find the fork in the design. Does the data fit in memory? How many requests reach the server? Third, do only that math out loud with round numbers. Then state the choice the number makes. This post follows one prompt the whole way through. It’s view receipts for 24-hour stories in a photo app. You’ll see the ritual version and the fork version. Then you get a full script to adapt, with current numbers.

Prep guides disagree on upfront estimates, even inside one company

Search for estimation advice and you’ll find two camps. Both come from companies that sell interview prep, so treat them as coaching, not rules.

The first camp treats estimation as a step you should be ready for. ByteByteGo’s undated estimation chapter says you are sometimes asked to estimate capacity. It teaches you to estimate traffic, storage, cache size and server counts. It also says the process matters more than the result.

The second camp says skip the upfront math. Hello Interview’s undated delivery framework notes that many guides put estimates into the requirements step. Its view is blunt: “We believe this is often unnecessary.” It suggests telling the interviewer you’ll do math during the design, when a result changes a choice.

Hello Interview co-founder Stefan Mai’s post on mastering estimation takes a softer line on the same question. He says estimating the crux of a problem early is a seniority signal. He budgets about one to three minutes of a 35-minute interview for it.

The two views fit together once you read them closely. Neither one wants five minutes of arithmetic that leads nowhere. Both want math that serves a decision. Mai’s “crux” is the decision. The delivery framework just moves the math to the moment the decision comes up. So the rule is about purpose. Estimate the number that picks a design, whenever it comes up.

The ritual estimate burns five minutes and picks nothing

Here’s the running example. The prompt is “Design view receipts for stories in a photo app.” A story disappears after 24 hours. The poster can see who viewed it. An Android engineer gets this prompt in a general system design round.

The ritual version starts with assumptions. Say 100 million daily users. Each one views 50 stories a day. That’s 5 billion views a day. A day has about 100,000 seconds. So that’s roughly 50,000 views a second. Each receipt holds a viewer ID and a story ID. That’s 16 bytes, or about 32 bytes once you allow for overhead. So 5 billion receipts take about 160 GB a day.

Then the candidate keeps going out of habit. Over a year, that’s about 58 TB. Five years is close to 300 TB. “So it’s a lot. We’ll need a sharded database.”

The arithmetic is fine. The conclusion is wrong. A story expires after 24 hours, so its receipts can expire with it. The yearly total describes data the system deletes. The candidate sized a database for a retention the product never asked for. Five minutes went into a number that pushed the design the wrong way.

Two things went wrong. The math came before the candidate understood the data’s lifetime. And no math was tied to a choice. “It’s a lot” is not a choice. Sharding is a choice. The numbers just didn’t support it.

Find the fork, then do back-of-the-envelope estimation on that

A fork is a point where two designs are both reasonable. A number tells you which one fits. Look for it before you estimate anything. In the stories prompt, there are two forks.

The first fork is where the receipts live. One option is a disk database with a cleanup job that deletes old rows. The other is an in-memory store with a time-to-live on each key. Redis, for example, can expire a key on its own after a set time. The number that decides is live data size. Receipts only live for about a day, so the live set is about 160 GB. AWS lists its m6i.32xlarge instance with 512 GiB of memory. So the whole live set fits in the memory of one large machine. In practice you’d spread it over a few nodes for replicas and headroom. That’s a small cluster, far from the 300 TB the ritual version planned for. The number makes the in-memory design viable.

The second fork is how receipts reach the server. An Android engineer can argue this one from the client side. One option is to send a request for every view. The other is to batch receipts on the device. The app sends them once, when the user leaves the stories viewer. One request per view means about 50,000 requests a second. Now assume five stories sessions per user per day. Batching gives 100 million times five, or 500 million requests a day. That’s about 5,000 requests a second, ten times fewer. The cost is delay. The poster sees new viewers a few seconds later. You also need to store the pending batch on the device. Then a killed app sends it on the next launch.

Each fork took about a minute. Each one ended in a decision the interviewer can push on. The ritual never produced one.

A sample script for the stories prompt

Here’s the full answer, run with estimates at the forks. Swap in your own prompt and numbers.

Before I start on scale, one question. Do receipts disappear when the story expires, or does the poster keep them? I’ll assume they expire after 24 hours.

I won’t do a full capacity sheet upfront. I’ll estimate at the points where a number picks the design. Does that work for you?

The first fork is where receipts live. Assume 100 million daily users who each view 50 stories. That’s 5 billion receipts a day. At about 32 bytes each, that’s around 160 GB. Since they expire daily, that’s the whole live set. It fits in memory on a few large machines. So I’ll keep receipts in an in-memory store with a 24-hour expiry, sharded by story ID. No cleanup job is needed.

The second fork is how receipts arrive. One request per view is around 50,000 a second. Say the Android client batches receipts and sends them when the user leaves the viewer. Then it drops to about 5,000. The cost is a few seconds of delay for the poster. I’ll take that. The client stores the pending batch locally, so a killed app sends it on the next launch.

These numbers are rough. If you think daily users are ten times higher, the memory answer changes first. Then I’d look at a disk-backed store with a time-to-live instead.

The first line asks about data lifetime before any math. That’s the question the ritual version skipped. The second line tells the interviewer how you’ll handle estimates. It gives them the chance to ask for a full sheet if their rubric wants one. Each fork names two options, does the math and states the choice. The last paragraph says which assumption would flip the decision. That shows you know where your design is fragile. It also hands the interviewer a good follow-up question.

Old latency tables can undercut your estimate

Estimates are only as good as the reference numbers behind them. Many of the tables candidates memorize are old.

Peter Norvig’s “Teach Yourself Programming in Ten Years” page has a well-known timing table. The page’s copyright runs from 2001 to 2014. The table is labeled for a typical PC. It lists a disk seek at 8 ms. It also lists 20 ms to read 1 MB sequentially from disk. Those figures describe spinning disks. ByteByteGo’s chapter warns that the latency numbers it reprints date from 2010. It says some of them are now outdated.

Hello Interview’s numbers to know page makes the same point more sharply. It says candidates lose credibility when they use scale numbers from 2015 or 2020. Its example is a machine with 512 GiB of memory, the same AWS figure used above.

The practical fix is small. Keep a handful of current figures you can name a source for. A large cloud machine’s memory is one. A cross-ocean round trip is another. Norvig’s table and Mai’s post both put that at about 150 ms. Use them to decide whether something fits. Don’t recite the whole table.

When the interviewer wants the full sheet anyway

Some interviewers will ask for QPS and storage before any design. Their rubric may have a line for it. Don’t argue. Do it fast in round numbers. Close each number with what it means.

For the stories prompt, that sounds like this. “About 50,000 views a second on average. Peak may be two or three times that, so plan for about 150,000. About 160 GB of live receipts, because they expire daily. Bandwidth is small, because each receipt is tiny.” Then move on. Each line still ends in a fact the design will use. That keeps the sheet from turning into the ritual.

Estimation also costs clock time. The deep dive is what gets squeezed. Our post on running out of time in a system design interview sets checkpoints that keep it short. For trade-off answers after the numbers, see what the senior Android system design round tests.

Leave a Comment