Problem solving · must-tier · asked at Amazon, Apple, Google, Meta, Microsoft, Netflix

What Happens When You Load a URL

mediumsystems-fundamentals

Problem

You type https://www.example.com/search?q=cats into a browser and press Enter. Walk through what happens, from the keystroke to pixels on screen, as a sequence of concrete steps with the protocols, the caches consulted, and the round trips involved.

Then answer the two questions interviewers actually care about:

  1. Where does the latency go? Give a round-trip budget for a first visit from a cold cache and for a repeat visit.
  2. Where can it fail, and what does the user see in each case?
  • Assume a modern browser, a home network, a site behind a CDN, HTTP/2 over TLS 1.3.
  • Be specific about which steps are cached and for how long.

Examples

  • Cold first visit, 50 ms round trip to the CDN edge: DNS 1 to 3 RTTs, TCP handshake 1 RTT, TLS 1.3 handshake 1 RTT, HTTP request and first byte 1 RTT, then transfer. Roughly 4 to 6 RTTs, 200 to 300 ms, before the first byte of HTML arrives.
  • Warm repeat visit: DNS cached, connection kept alive or TLS session resumed with 0-RTT, so the request goes out immediately and the first byte arrives in about 1 RTT. Assets come from the HTTP cache with no network at all if fresh.
  • Failure example: DNS resolves but the TCP SYN gets no reply. The browser retries with exponential backoff and shows "This site can't be reached, took too long to respond" after about 20 to 30 seconds.

Hints

  1. Before any packet leaves the machine, the browser has several places to find the answer already. Name three.
  2. Count the round trips: each handshake is at least one. Which of them can be skipped on the second visit, and by what mechanism?
  3. After the HTML arrives, what blocks the first paint, and what does the browser do in parallel?

Last reviewed 8 September 2026