Latency numbers and latency budgets for system design

Latency numbers are rough orders of magnitude for common operations: nanoseconds for memory, microseconds for an SSD read or a hop inside a data center, milliseconds for a disk seek or a nearby region, and around a hundred milliseconds to cross an ocean and back. Their value in an interview is in adding them up: a latency budget lists every hop on a request's critical path, adds the sequential ones, takes the slowest of the parallel ones, and checks the total against the product's target, including the slow tail.

By Published 10 min read

1. The numbers, as rungs on a ladder

You do not need a long table in your head, just five rungs, each roughly a thousand or a hundred times the one below. Reading from memory takes on the order of 100 nanoseconds. A random read from an SSD or a round trip between two servers in the same data center takes on the order of 100 microseconds to half a millisecond. A spinning-disk seek or a round trip to a nearby region is in the low milliseconds to tens of milliseconds. An intercontinental round trip is on the order of 100 milliseconds or more. The full circulated list, with its caveats about age, is in capacity estimation; this page is about what you do with it.

2. Why interviewers care about latency arithmetic

Statements like "the cache makes it fast" or "we call the three services" hide a budget. Interviewers want to see that you can take a target such as "the page must load its data in 200 milliseconds" and check whether your design can meet it, then spot what blows the budget: an extra region crossing, a loop of sequential lookups, or a fan-out so wide that the slowest shard sets the pace. It is the fastest way to show quantitative reasoning after the capacity estimate.

3. Building a latency budget

  1. State the target as a percentile"p99 under 200 ms for the API call" is a target; "fast" is not. Agree whether it includes the client's network.
  2. List the critical pathEvery hop the request waits on, in order: client to edge, edge to region, load balancer, service, cache, database, downstream calls, and back.
  3. Mark sequential and parallelCalls that depend on earlier results are sequential; independent calls can run in parallel.
  4. Add a number to each hopUse the ladder for orders of magnitude and your own assumptions for service time. Label them as assumptions.
  5. Compare with the target, then fix the biggest termUsually one item dominates: a region crossing, a slow dependency or a chain of lookups. Move it off the critical path, cache it, batch it or run it in parallel.
target: p99 under 200 ms, measured at the edge

edge to the region's load balancer        5 ms   (user served from a nearby region)
load balancer + gateway + auth check      3 ms
product service: cache lookup             1 ms   (in-region round trip + lookup)
parallel group, wait for the slowest:
    price service          15 ms
    inventory service      20 ms
    reviews summary        40 ms   <- slowest, sets the group's time
                                         40 ms
serialize and return                      2 ms
----------------------------------------------
typical total                           ~ 51 ms
p99 headroom left                       ~149 ms for slow calls, retries and GC pauses

if the three calls ran one after another:  15 + 20 + 40 = 75 ms instead of 40
A product page API call, budgeted (all figures are assumptions for illustration)

Notice that the typical total is far under the target. That headroom is not waste: it is what absorbs the tail, which is where most real budgets are lost.

4. Sequential calls and the hidden loop

The most common budget breaker is a loop of small calls. Loading 50 items one by one, each a half-millisecond round trip to a cache or database in the same data center, costs about 25 ms of waiting before any work is done. Inside one request that might be acceptable; as an N+1 query pattern in a page that renders 500 items, it is not. One batched call (a multi-get or an IN query) pays the round trip once. When you draw a service calling another in a loop, say "batched" out loud.

  • Batch lookups to the same store into one request.
  • Parallelize independent calls to different services.
  • Denormalize or precompute when a page always needs data assembled from several places.
  • Move work off the critical path: send the email, update counters and write analytics after responding, through a queue.

5. Distance and handshakes

Light in optical fiber travels at roughly two thirds of its speed in a vacuum, about 200,000 km a second, or 200 km per millisecond one way. A round trip therefore costs about 1 ms for every 100 km of distance, before any routing detours or processing. New York to London is about 5,600 km in a straight line, so the physical floor for a round trip is around 56 ms; measured round trips are higher because cables do not follow straight lines and every router adds a little.

Round trips a new secure connection pays before the response (typical cases)
StepRound tripsNotes
TCP handshake1Before any data can be sent
TLS 1.3 handshake1TLS 1.2 typically needs 2; resumed sessions can need fewer
The request and response itself1 or moreMore if the response is large and the connection is new
Total for a fresh HTTPS requestAbout 3Across an ocean, roughly 3 x 70 to 100 ms before the first byte
Round trips a new secure connection pays before the response (typical cases). Scroll sideways on a small screen.

This is why designs terminate connections close to users at CDN or edge servers, keep long-lived connections from the edge back to the origin, and reuse connection pools between services. HTTP/3 over QUIC combines the transport and encryption handshakes to save a round trip, which matters most on long distances and mobile networks. For data, the rule is the same: keep the reads a user makes on the critical path in their own region, and accept that a write needing agreement across continents costs at least one ocean round trip.

6. Tail latency and fan-out

Averages hide the requests users complain about. Report latency as percentiles: p50 (typical), p99 (one request in a hundred is slower) and p99.9. Tails get worse with fan-out. If a request calls 100 servers in parallel and must wait for all of them, it is as slow as the slowest. Even if each server is slow only 1% of the time, most requests will hit at least one slow server. Jeff Dean and Luiz André Barroso's article "The Tail at Scale" is the usual reference for this effect.

import random

def p_any_slow(fanout, p_slow=0.01):
    """Chance that at least one of `fanout` parallel calls is slower than its own p99."""
    return 1 - (1 - p_slow) ** fanout

for n in (1, 10, 100):
    print(n, round(p_any_slow(n), 3))     # 1 0.01 / 10 0.096 / 100 0.634

# Monte Carlo check: each backend takes 10 ms, except 1% of calls take 200 ms
rng = random.Random(1)
def call():
    return 200 if rng.random() < 0.01 else 10
def request(fanout):
    return max(call() for _ in range(fanout))   # parallel: wait for the slowest
trials = 20_000
print(round(sum(request(100) >= 200 for _ in range(trials)) / trials, 3))   # 0.632
How fan-out turns a rare slow call into a common slow request (run with python3)
  • Hedged requests. If a call has not returned by about its p95, send a second copy to another replica and take whichever answers first. It costs a few percent more load and cuts the tail sharply.
  • Timeouts and partial results. For search or feeds, return what arrived in time and drop the stragglers, if the product tolerates it.
  • Smaller fan-out. Fewer, larger shards, or routing by key so a request touches one shard instead of all of them. See sharding.
  • Retry budgets. Retries add latency and load; cap them so a slow dependency does not become an overloaded one.

7. Latency and throughput: Little's law

Little's law says the average number of requests in a system equals the arrival rate times the average time each spends there. A service handling 2,000 requests a second at 50 ms each has about 100 requests in flight at any moment. That number sizes thread pools, connection pools and database connections. It also explains a common failure: when a dependency slows from 50 ms to 500 ms, requests in flight jump tenfold to about 1,000, pools fill, and the service starts failing even though traffic did not change. Timeouts and load shedding exist to stop that chain.

8. How it shows up in common prompts

Latency questions inside walk-throughs
PromptThe budget questionWhat usually fixes it
Search autocompleteSuggestions must appear while the user types, so the whole round trip has very little timePrecomputed top results per prefix, served from memory near the user
URL shortenerA redirect should add almost nothing to the page loadCache hot codes; serve redirects from regions near users
Payment systemThe payment provider call is slow and variableAccept the order, show "processing", finish asynchronously
NetflixVideo start time across continentsContent on edge servers inside or near the viewer's network
UberMatching a rider within secondsLocation data in memory, partitioned by area, no cross-region calls on the path
Latency questions inside walk-throughs. Scroll sideways on a small screen.

9. Interview questions on latency

Questions to practice and what a good answer contains
QuestionWhat a good answer contains
Why use p99 instead of the average?Averages hide the slow requests users notice; tails grow with fan-out
Our API calls five services one after another. How do we speed it up?Find which are independent and run them in parallel; batch, cache or move the rest off the path
Why is a database in another region a problem for reads?Each read pays a cross-region round trip, tens of milliseconds or more
How far can light go in a millisecond of fiber?About 200 km one way, so roughly 1 ms of round trip per 100 km
What is a hedged request?A duplicate sent after a delay to another replica, first reply wins
How many requests are in flight at 2,000 a second and 50 ms each?About 100, by Little's law
Why do new HTTPS connections feel slow far away?TCP and TLS handshakes add round trips before the request
Where does a cache sit in the budget?It replaces a slower hop with a faster one, but still costs a network round trip if remote
Questions to practice and what a good answer contains. Scroll sideways on a small screen.

10. Mistakes to avoid

  • Reciting the list without using it. Numbers only help when they add up to a decision.
  • Adding parallel calls together. The group costs the slowest call, not the sum.
  • Budgeting the average. Budget the p99 and leave headroom for the tail.
  • Ignoring handshakes and distance. A design that crosses an ocean on every request cannot be fixed by faster servers.
  • Presenting old figures as benchmarks. Treat the circulated numbers as orders of magnitude and say so.

11. How to talk about it in the interview

  • Ask for or propose a latency target with a percentile.
  • Walk the critical path once with rough numbers, marking what runs in parallel.
  • Name the biggest term and what you would do about it.
  • Mention the tail: fan-out, hedging or timeouts, and where the headroom goes.

Fictional example

A dashboard for a fleet of delivery vans
Interviewer
The fleet dashboard calls 40 regional services to show each region's vans. It is slow. Why?
Candidate
The page waits for all 40, so its speed is the slowest region's speed. If each region is slow one time in a hundred, about a third of page loads hit at least one slow region, since 1 minus 0.99 to the 40th is roughly 0.33.
Candidate
I would have each region push van positions into one store the dashboard reads, so loading the page is a single query. If that is not possible, I would set a timeout and show regions that answered, marking the rest as updating, and hedge calls that pass their usual p95.
Interviewer
What target would you set?
Candidate
p99 under 300 milliseconds for the dashboard's data call, measured from the browser, with positions up to ten seconds old, because a van rarely moves far enough in ten seconds to change a dispatcher's decision.

Saying the arithmetic out loud with Natively

Latency budgets are arithmetic you have to narrate, and under pressure it is easy to add parallel calls or forget the handshake. Practice a budget in a mock interview while Natively transcribes what you say on your computer; you can trigger a suggested answer for the interviewer's last question, or a recap of the session so far, without stopping. If your budget is in a screenshot or on a slide, it can read it and point out what the picture shows. Reviewing the transcript later shows exactly which numbers you stated and which you skipped.

Questions people ask

What latency numbers should I know for system design interviews?

Know the orders of magnitude: about 100 nanoseconds for a memory read, roughly 100 microseconds to half a millisecond for an SSD read or a round trip inside a data center, milliseconds for a disk seek or a nearby region, and about 100 milliseconds or more for an intercontinental round trip. Treat them as rough rungs, not benchmarks.

What is a latency budget?

It is a breakdown of a request's target response time across every hop on its critical path, such as the network, gateway, cache, database and downstream calls. Sequential hops add up and parallel hops cost as much as the slowest one. Comparing the total against a percentile target shows which hop to fix.

Why does fan-out make tail latency worse?

A request that waits for many parallel calls is as slow as the slowest of them. If each call is slow 1% of the time, a request with 100 such calls hits at least one slow call about 63% of the time. Hedged requests, timeouts with partial results and smaller fan-out reduce the effect.

How much latency does distance add?

Light in optical fiber covers roughly 200 km per millisecond, so each 100 km of distance adds about 1 ms to a round trip before routing detours and processing. New connections also pay extra round trips for the TCP and TLS handshakes, which is why connections are terminated near users and reused.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP