What Happens When You Load a URL
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:
- Where does the latency go? Give a round-trip budget for a first visit from a cold cache and for a repeat visit.
- 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
- Before any packet leaves the machine, the browser has several places to find the answer already. Name three.
- Count the round trips: each handshake is at least one. Which of them can be skipped on the second visit, and by what mechanism?
- After the HTML arrives, what blocks the first paint, and what does the browser do in parallel?
Last reviewed 8 September 2026
Approach · Answer · Complexity · Follow-ups · Company variations
The rest of this question — the worked approach, the Python solution with passing tests, complexity, follow-ups and how each company frames it — is part of the guides.
Get the full guide
Pick the company you're interviewing with. Each guide has every question tiered for that loop — one-time purchase, lifetime access.
Also in: Apple, Google, Meta, Microsoft, Netflix
Interviewing at more than one? All 6 guides for $499 · save $395
Not ready to buy? Get the free starter pack — 13 questions with full solutions.