Scrivio Interview library
DebuggingIntermediate6 min read · updated 13 November 2026

A new 'share to friends' feature was estimated at 2,000 writes per second from 50 million daily users divided over 86,400 seconds. On launch day the database received 18,000 writes per second within minutes of a push notification and fell over.

What did the estimate miss, and how should load estimates for a launch be built?

The estimate divided daily users by the seconds in a day, which gives an average, but a push notification concentrates the reaction into a few minutes, so the peak can be ten or more times higher. It also counted actions instead of writes, although one share writes several rows, and it ignored retries, which multiplied the load once the database slowed. Launch estimates should be built as a funnel (users reached, fraction acting in the first minutes, writes per action, fan-out, retries), given 2 to 3 times headroom and verified with a load test, and the launch itself should stagger notifications, queue non-urgent writes and cap concurrency.

Background to this question

'Daily users divided by 86,400' is the first estimate everyone learns, and for steady traffic it is a reasonable starting point. For a launch it is dangerously wrong, because launches are designed to make many people do the same thing at the same moment. This debugging question asks us to explain a nine-fold miss and to show a better method. In this answer, we will find the three things the estimate missed, rebuild it as a funnel with numbers, and change how the launch itself is run so overload degrades gracefully instead of taking the database down.

1What the Original Estimate Assumed

The estimate took 50 million daily users, assumed some number of shares each, and spread the resulting writes evenly over 86,400 seconds, arriving at about 2,000 writes per second. Hidden in that division is an assumption that traffic is flat across the day. For a new feature announced by push notification, the opposite is true: most of the day's activity happens in the first few minutes after the notification arrives.

2Miss 1: Peak Versus Average

A push notification sent to everyone at once reaches tens of millions of phones within a minute or two. A small fraction of people open it immediately, and a feature called 'share to friends' invites them to act right away. The result is that a large share of the day's actions lands in the first ten minutes.

If even a quarter of the day's shares happen in the first ten minutes, the rate in that window is the daily total divided by 600 seconds instead of 86,400, which is 144 times the average multiplied by a quarter, or about 36 times. So the rule is to estimate from the busiest minute, not from the day. For launches, that minute is shaped by how the notification is sent.

3Miss 2: Write Amplification

The estimate counted user actions as if each were one write. In reality, one share writes several rows: the share record itself, a notification row for each recipient, a feed entry, and updates to indexes on each of those tables. If a typical share goes to three friends, that is one share row, three notification rows and a feed entry, five rows, each also updating one or two indexes.

This is write amplification: one action causing several physical writes. Estimates should count writes per action, by walking through what the code actually inserts and updates, not actions.

4Miss 3: Retries Under Stress

When the database slowed down, requests started to time out. The mobile clients retried, the API service retried its database calls, and some users tapped the button again. Each layer's retries multiplied the load at exactly the moment the database had no spare capacity, which turned a slowdown into a collapse. This feedback loop is called a retry storm.

Step throughHow a slowdown becomes a collapse
  1. Notification reaches millions of usersShares start within seconds
  2. Writes exceed database capacityLatency rises, connections pile up
  3. Requests time outClients, services and users all retry
  4. Retries add more loadEffective rate grows, success rate falls
  5. Database falls over18,000 writes per second observed

5 steps in order. Play them, or step through them one at a time.

An estimate for a launch therefore needs to include what happens under stress: how many times each layer retries, with what backoff, and whether anything caps the total.

5Building the Estimate as a Funnel

A better estimate follows the users through a funnel, step by step, and makes every assumption visible so it can be challenged.

Text
users reached by the push = 50,000,000
act in the first 10 minutes (2%) = 1,000,000 shares
average over 10 minutes = 1,000,000 / 600 s = ~1,700 shares/s
busiest minute (2x the window avg) = ~3,400 shares/s
writes per share (1 + 3 + 1) = 5 rows
writes at the busiest minute = 3,400 x 5 = ~17,000 writes/s
retries (say 1.5x while degraded) = ~25,000 writes/s
plan with 2-3x headroom = test at 35,000 to 50,000 writes/s, or change the launch

Notice how close the funnel's 17,000 is to the 18,000 observed, before retries. The numbers are assumptions, but each one is a question someone can answer from past launches: what fraction of users opens a push in the first ten minutes, how many friends does a share go to. Finally, we verify with a load test against a production-like database at the planned peak, including the retry behaviour, because estimates show the shape of the problem and tests confirm it.

6Changing the Launch, Not Just the Capacity

Buying enough database capacity for 50,000 writes per second for ten minutes a year is expensive. It is usually better to change the shape of the load. We stagger the notification, sending it in waves over 30 to 60 minutes, which divides the peak by the number of waves. We put a queue such as Kafka or SQS in front of writes that do not need to be synchronous, such as recipient notifications and feed entries: the share is recorded immediately and the fan-out is processed at a controlled rate. And we cap concurrency at the service, with a limited connection pool and load shedding that returns a quick 'try again shortly' when the limit is reached, plus retries with exponential backoff and jitter on the clients. Then overload makes some shares slower instead of making all of them fail.

7Follow-up questions

How would you stagger the notification without delaying it too much?

Send it in waves, for example ten waves over 30 minutes, choosing users by a hash of their id so each wave is a random slice. Measure the write rate after each wave and let the sender speed up or slow down to keep it below a target, such as 60 percent of tested capacity. Time zones help naturally too: sending at 7 pm local time in each zone spreads the load across hours. A 30-minute spread is rarely noticed by users but cuts the peak by roughly ten times.

Why add jitter to retries?

Without jitter, all clients that failed at the same moment retry at the same moment after the same backoff, creating synchronised waves. Random jitter spreads the retries out so the database sees a smoother load.

Which metrics should be watched during a launch?

Write rate and latency on the database, connection pool usage, error and timeout rates, queue depth for asynchronous work, and the notification sender's progress, with a kill switch to pause sending.

8Conclusion

In this answer, we found three things the estimate missed: the peak created by a push notification, write amplification from one action writing several rows, and retries multiplying load once the database slowed. We rebuilt the estimate as a funnel that reached about 17,000 writes per second before retries, close to what was observed, added headroom and a load test, and changed the launch itself by staggering notifications, queueing non-urgent writes and capping concurrency.

What to say in the interviewAbout 90 seconds aloud

Open with

The estimate used daily users divided by 86,400, which is an average, but a push notification to everyone concentrates the reaction into minutes, so the peak can easily be ten or more times the average.

Then, if they want more

I always estimate from the busiest minute for a launch. Second, it counted actions, not writes. One share writes the share itself, a notification row per recipient, a feed entry and index updates, so maybe five rows or more per action.

Third, it ignored retries: once the database slowed, clients and services retried, users tapped again, and that retry storm turned a slowdown into a collapse. I would build launch estimates as a funnel: users reached, the fraction who act in the first ten minutes, writes per action including fan-out, then a retry factor.

For example, two percent of fifty million acting in ten minutes, doubled for the busiest minute, times five writes, gives about seventeen thousand writes a second, very close to what happened. Then I add two to three times headroom and verify with a load test.

But I would also change the launch: send the notification in waves over thirty minutes or so, put a queue in front of non-urgent writes like notifications and feed entries, and cap concurrency with backoff and jitter, so overload slows things down instead of failing everything.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What did the estimate miss, and how should load estimates for a launch be built?": https://scrivio-interview-library.netlify.app/architecture/sd-fundamentals/84b7d27367/