Overview
This is the most common warm-up question in system design interviews. Typing https://shop.example.com/cart and pressing Enter triggers a chain: URL parsing, DNS resolution, a TCP connection, a TLS handshake, the HTTP request, server-side processing, the response, and finally the browser rendering HTML, CSS, and JavaScript, often making dozens of further requests.
A great answer walks through each stage, names what can be cached or skipped, and points out where latency comes from. It also shows you understand the systems behind the scenes: DNS resolvers, CDNs, load balancers, application servers, caches, and databases.
You look up the address (DNS), drive there (TCP connection), confirm it is the real restaurant and agree on a private language (TLS), order (HTTP request), the kitchen cooks (server processing), and your food arrives in courses (the browser downloads and renders resources).
When to use it
- Interview warm-up questions about web fundamentals.
- Diagnosing slow page loads: which stage takes the time?
- Explaining where CDNs, load balancers, and caches sit in the path.
- Planning performance optimizations such as preconnect and HTTP/2.
Where it shows up in interviews
Recognize it when: walk me through what happens between the user and your service.
- What happens when you type google.com
- Design a web application's request path
Recognize it when: the page is slow; where would you look?
- Optimize a slow e-commerce homepage
- Design for mobile users on 3G
Where it is used in real software
The Network tab shows each request broken into DNS lookup, initial connection, TLS, waiting for the server (TTFB), and content download.
Sites use <link rel="preconnect"> and dns-prefetch to start DNS and TLS early for third-party domains like fonts and analytics.
Google ranks pages partly by Largest Contentful Paint and Interaction to Next Paint, which depend on every stage of this flow.
Key terms
- TTFB
- Time to first byte: from sending the request to receiving the first response byte.
- Critical rendering path
- The steps the browser takes to turn HTML, CSS, and JS into pixels.
- Keep-alive
- Reusing a TCP/TLS connection for multiple requests.
- HSTS
- A header telling browsers to always use HTTPS for a domain.
The full request lifecycle
- 1Parse the URL and check caches
Scheme (https), host (shop.example.com), path (/cart). The browser checks HSTS and its HTTP cache; a fresh cached response may skip the network entirely.
- 2Resolve DNS
Browser cache, OS cache, then a recursive resolver, which may query root, TLD, and authoritative name servers to get the IP address.
- 3Open a TCP connection
Three-way handshake SYN, SYN-ACK, ACK: one round trip. With HTTP/3 this is QUIC over UDP instead.
- 4TLS handshake
Negotiate the cipher, verify the server certificate against trusted authorities, and derive session keys. TLS 1.3 needs one round trip.
- 5Send the HTTP request
GET /cart with headers like Host, Cookie, and Accept. It usually reaches a CDN or load balancer first.
- 6Server processes the request
Load balancer routes to an app server, which authenticates the session, reads caches or databases, and renders a response.
- 7Browser renders
Parse HTML into the DOM, fetch CSS and JS, build the render tree, lay out, and paint. Additional resources trigger more requests, reusing the connection.
STEP 1Parse the URL, check HSTS and the browser cache. A cache hit could stop here.
Where the time goes on a first visit (100 ms RTT)
Cold visit, no cached DNS or connections, TLS 1.3, HTTP/2
| Stage | Round trips | Approximate time |
|---|---|---|
| DNS lookup (cache miss) | 1-2 | 50-150 ms |
| TCP handshake | 1 | 100 ms |
| TLS 1.3 handshake | 1 | 100 ms |
| HTTP request + server work | 1 + processing | 100 ms + 50 ms |
| Download HTML, then CSS/JS | 2-3 more | 200-300 ms |
NOWStage: DNS lookup (cache miss) | Round trips: 1-2 | Approximate time: 50-150 ms
Roughly 600-800 ms before first paint, mostly round trips rather than server work. That is why CDNs (shorter RTT), connection reuse, HTTP/3 (fewer handshakes), and inlining critical CSS matter so much.
Implementation
# Break a request into its stagescurl -o /dev/null -s -w ' dns: %{time_namelookup}s tcp: %{time_connect}s tls: %{time_appconnect}s first byte: %{time_starttransfer}s total: %{time_total}s' https://example.comComplexity and performance
TCP + TLS 1.3 (+ DNS).
Repeat visits.
Server plus network.
Trade-offs
Server-side rendering sends usable HTML sooner; client-side rendering needs JavaScript to download and run before content appears, but can make later navigation faster.
Long cache lifetimes skip network stages entirely but risk stale content; use versioned file names for static assets.
Variants and related techniques
DNS, connections, and assets are cached; often only one request for the HTML is needed.
A script intercepts requests and can serve responses offline from its own cache.
Common mistakes
- Skipping DNS and TLS in the explanation.
Fix: Interviewers expect each stage: DNS, TCP, TLS, HTTP, server, rendering.
- Forgetting redirects.
Fix: http:// to https:// or example.com to www.example.com adds full round trips; HSTS preload avoids the first one.
- Treating the server as a single box.
Fix: Mention CDN, load balancer, app servers, cache, and database.
Interview questions
How would you make this faster for a user far from your servers?
Serve static assets and cacheable pages from a CDN near the user, reuse connections with HTTP/2 or HTTP/3, reduce redirects, compress responses, and deploy the application in more regions.
What is cached along the way?
DNS answers (browser, OS, resolver), TLS sessions, HTTP responses (browser cache, CDN), application data (Redis), and database pages (buffer pool).
Practice problems
| Problem | Difficulty | What it trains |
|---|---|---|
| Explain the flow in under 3 minutes | Easy | Structured answer. |
| Measure a real site with curl timing | Easy | Stage breakdown. |
| Cut first-visit load time in half for a global audience | Medium | CDN, HTTP/3, caching. |