Scrivio Interview library
ConceptFoundations6 min read · updated 13 November 2026

Designers use rough latency numbers to judge a design before building it: how long a memory read, an SSD read, a network round trip within a data centre and a round trip across a continent take, in orders of magnitude.

Give the rough order of magnitude for those operations, and use them to judge a request that makes 30 sequential database calls in the same zone and one call to another continent.

Rough orders of magnitude: a main memory access is about 100 ns, a local SSD read tens to around a hundred microseconds, a round trip within a data centre or zone about 0.1 to 0.5 ms, a spinning disk seek about 10 ms, a round trip within a continent 10 to 40 ms, and across continents roughly 70 to 150 ms or more. So 30 sequential database calls at about 1 ms each add around 30 ms, while the single cross-continent call adds at least one long round trip, and two or three more if it opens a new TCP and TLS connection. The lessons are to batch or parallelise chatty calls, keep request paths inside one region, reuse connections, and measure the real numbers in our own environment.

Why this question is asked

Before we build anything, we can often tell whether a design will be fast enough by counting what it does and multiplying by a few well-known numbers. A request that reads memory a thousand times is fast; one that crosses an ocean three times is not, no matter how good the code is. Interviewers ask about latency numbers to see whether we have this intuition and can apply it to a concrete request. In this answer, we will go through the orders of magnitude that matter, see why they are what they are, apply them to a request with 30 sequential database calls and one cross-continent call, and draw the design lessons.

1The Numbers Worth Remembering

We do not need exact figures; we need the order of magnitude, the power of ten. Each step down the table below is roughly ten to a thousand times slower than the one above, which is why the gaps matter more than the exact values.

Rough latency of common operations
OperationRough latencyIn milliseconds
Main memory accessabout 100 ns0.0001 ms
Read 4 KB from a local NVMe SSDtens to about 100 microseconds0.02 to 0.1 ms
Round trip in the same zone100 to 500 microseconds0.1 to 0.5 ms
Simple indexed query in the same zoneabout 1 ms including the round tripabout 1 ms
Spinning disk seekabout 10 ms10 ms
Round trip, same continent10 to 40 ms10 to 40 ms
Round trip, across continents70 to 150 ms or more70 to 150 ms

The bottom rows are set by physics. Light in optical fibre travels at about two thirds of its speed in a vacuum, roughly 200 km per millisecond. A round trip between the US east coast and Western Europe covers well over 10,000 km of fibre in total, so it cannot be faster than about 60 ms, and real routes with routers in between give 70 to 90 ms. No amount of optimisation in our code changes that.

2Applying the Numbers to Our Request

Now the request in the question: it makes 30 database calls one after another in the same zone, then one call to a service on another continent. A simple indexed query costs about 1 ms including the network round trip and the database's own work, so 30 sequential calls add about 30 ms. That is noticeable but not terrible on its own.

The cross-continent call costs at least one long round trip, say 80 to 150 ms. If the connection is already open and reused, that is the whole cost. If the service opens a new connection for the call, it first pays for the handshakes: one round trip for the TCP handshake and one more for a TLS 1.3 handshake before the request can even be sent, then the request itself. That is three long round trips, perhaps 250 to 450 ms. One careless 'new HttpClient per call' can therefore cost more than everything else in the request combined.

Step throughCross-continent call on a new connection
Our serviceRemote service
TCP SYN
SYN-ACK (1st round trip)
TLS 1.3 ClientHello
ServerHello, Finished (2nd round trip)
HTTP request
HTTP response (3rd round trip)

6 messages in order. Play them, or step through them one at a time.

With a reused connection only the last round trip remains: about 80 to 150 ms instead of 250 to 450 ms.

3Lesson 1: Avoid Chatty Sequential Calls

Thirty calls in a row is usually a loop over ids, the classic N+1 query pattern. Each call waits for the previous one, so their latencies add up. Batching them into one query pays one round trip instead of thirty.

Java
// 30 sequential round trips: about 30 ms
for (Long id : orderIds) {
orders.add(orderRepository.findById(id).orElseThrow());
}
// one round trip with an IN list: about 1 to 2 ms
List<Order> orders = orderRepository.findAllById(orderIds);
// calls to different services that do not depend on each other: run them in parallel
CompletableFuture<Profile> p = CompletableFuture.supplyAsync(() -> profiles.get(userId), pool);
CompletableFuture<Cart> c = CompletableFuture.supplyAsync(() -> carts.get(userId), pool);
CompletableFuture.allOf(p, c).join(); // takes as long as the slower call, not the sum

Notice the difference between the two fixes. Batching reduces the number of round trips. Parallelising keeps the number but overlaps them, so the request waits only for the slowest. When calls depend on each other, neither works, and the fix is to move the work closer to the data, for example into one query with a join.

4Lesson 2: Keep the Request Path in One Region, and Reuse Connections

A single cross-continent round trip dominates everything else in the request, so the most valuable design rule is to keep a user's request path inside one region. If the remote service's data is needed on every request, we replicate or cache it locally; if the call can happen after the response, we make it asynchronous through a queue.

When a remote call is unavoidable, connections must be reused. A pooled HTTP client, or HTTP/2 with many requests over one connection, pays the handshakes once and then only the request round trip. TLS session resumption and HTTP/3 over QUIC, which combines the transport and TLS handshakes, reduce the cost of new connections further.

5These Are Numbers to Reason With, Not to Rely On

The table gives orders of magnitude for reasoning in a design discussion. Real values depend on hardware, cloud provider, region pairs, network congestion and load. Before relying on them for a latency budget, we measure: ping and TCP connect times between our actual regions, query latency percentiles from the database's own statistics, and per-call timings from distributed tracing such as OpenTelemetry. Measurement often reveals surprises, such as a 'same zone' database that is actually in another zone.

6Follow-up questions

How many round trips does a new HTTPS connection cost before the first request?

With TLS 1.3, two: one for the TCP handshake and one for the TLS handshake, after which the request goes out and its response takes a third round trip. With TLS 1.2 the TLS handshake takes two round trips, so three before the request. TLS 1.3 session resumption with 0-RTT data can send the request with the first TLS message, and HTTP/3 over QUIC combines the transport and TLS handshakes into one round trip, or zero on resumption.

Why is a spinning disk seek so slow compared with an SSD?

Because it is mechanical: the head has to move to the right track and wait for the platter to rotate under it, which takes milliseconds. An SSD has no moving parts and reads from flash in tens of microseconds.

Is 30 ms for 30 queries acceptable?

It depends on the latency budget. For an API with a 100 ms target it uses almost a third of it for no good reason, and the cost grows with the size of the list, so it is worth batching anyway.

7Conclusion

In this answer, we went through the orders of magnitude that matter, from about 100 ns for memory to 70 to 150 ms for a round trip across continents, and saw that the long ones are set by the speed of light in fibre. Applied to our request, 30 sequential database calls add about 30 ms, while the cross-continent call adds at least one long round trip and three if it opens a new connection. The lessons are to batch or parallelise chatty calls, keep the request in one region, reuse connections, and measure real numbers before relying on them.

What to say in the interviewAbout 90 seconds aloud

Open with

Roughly: a main memory access is around a hundred nanoseconds, an SSD read is tens to about a hundred microseconds, a round trip inside a zone is about a tenth to half a millisecond, a spinning disk seek about ten milliseconds, a round trip within a continent ten to forty milliseconds, and across continents seventy to a hundred and fifty or more, which is set by the speed of light in fibre.

Then, if they want more

For the request in the question, thirty sequential database calls at about a millisecond each, including query time, add around thirty milliseconds. The one call to another continent adds at least one long round trip, say a hundred milliseconds.

If it opens a fresh connection, TCP takes one round trip and TLS 1.3 another before the request even goes out, so that could be three hundred milliseconds or more, more than everything else combined.

So the lessons are: batch the thirty calls into one query or run independent calls in parallel, keep the request path inside one region by replicating or caching what we need or making the remote call asynchronous, and always reuse pooled connections so handshakes are paid once.

And I would treat these numbers as orders of magnitude for reasoning; before building a latency budget, I would measure the real ones in our environment with tracing.

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 "Give the rough order of magnitude for those operations, and use them to judge a request...": https://scrivio-interview-library.netlify.app/architecture/sd-fundamentals/a392ac0464/