Seven estimates a design round needs

estimation drillmedium
25:00

"Before we design anything, let's make sure we can size it. I'll give you seven quick estimates of the kind every design round needs. Talk me through each one. I care more about your method and your assumptions than the last digit."

  1. Searches per second. A marketplace has 40 million daily active users, and each runs 12 searches a day. What's the average search rate per second, and the peak?
  2. Log storage. Each search logs the 25 listings it showed, at 150 bytes per row. How much storage is that per day, and for 180 days of retention?
  3. Embedding index memory. You have 800 million item vectors of 128 dimensions in float32. How much memory does a flat index take? How much does an IVF index with product quantization take, at M = 16 sub-vectors of 8 bits each, plus the 8-byte id Faiss stores per vector? Does each fit on a machine with 256 GB of RAM?
  4. GPUs for a token load. A chat feature peaks at 150 requests a second, each generating 400 output tokens on average. One GPU sustains 2,000 output tokens a second at the latency target, and you plan to run at 60% of that. How many GPUs, and how many 8-GPU nodes?
  5. Backlog drain. A batch inference queue receives 5,000 jobs a minute, and the workers can process 6,000 a minute. Processing stops for 45 minutes while jobs keep arriving. How long after recovery until the backlog is gone? How long if you double the workers for the drain?
  6. Fan-out tail. A request fans out to 50 shards in parallel and waits for all of them. Each shard is slower than 100 ms on 1% of calls. What share of requests is slower than 100 ms? What per-shard slow rate would keep that under 1%?
  7. Servers from concurrency. At the peak from question 1, each search spends 120 ms in the ranking tier. How many searches are in flight there at once? If one ranking server holds 64 concurrent requests and you plan at 70% of that, how many servers?

Ask the interviewer

Write your own questions first, then compare.

  • Should I use 86,400 or 100,000 seconds in a day?

  • Is the peak-to-average ratio given?

  • Are gigabytes powers of ten or powers of two?

  • Should storage include replication?

  • What does the per-GPU throughput include?

  • Are the shards' slow responses independent of each other?

Follow-ups

In the room these come after your design, not before. Write your first pass, then open them and answer each one.

Your answer
0 words