FOUNDATIONS / SYSTEM CONCEPT BRIEF

What happens when you type a URL

This is the most common warm-up question in system design interviews.

BeginnerPhase 01 / Topic 2 of 17RequirementsTrade-offsFailure modes
01

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.

Ordering from a restaurant you have never visited

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).

02

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.
03

Where it shows up in interviews

Web request path

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
Performance optimization

Recognize it when: the page is slow; where would you look?

  • Optimize a slow e-commerce homepage
  • Design for mobile users on 3G
04

Where it is used in real software

Browser DevTools waterfall

The Network tab shows each request broken into DNS lookup, initial connection, TLS, waiting for the server (TTFB), and content download.

Resource hints

Sites use <link rel="preconnect"> and dns-prefetch to start DNS and TLS early for third-party domains like fonts and analytics.

Core Web Vitals

Google ranks pages partly by Largest Contentful Paint and Interaction to Next Paint, which depend on every stage of this flow.

05

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.
06

The full request lifecycle

  1. 1
    Parse 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.

  2. 2
    Resolve DNS

    Browser cache, OS cache, then a recursive resolver, which may query root, TLD, and authoritative name servers to get the IP address.

  3. 3
    Open a TCP connection

    Three-way handshake SYN, SYN-ACK, ACK: one round trip. With HTTP/3 this is QUIC over UDP instead.

  4. 4
    TLS handshake

    Negotiate the cipher, verify the server certificate against trusted authorities, and derive session keys. TLS 1.3 needs one round trip.

  5. 5
    Send the HTTP request

    GET /cart with headers like Host, Cookie, and Accept. It usually reaches a CDN or load balancer first.

  6. 6
    Server processes the request

    Load balancer routes to an app server, which authenticates the session, reads caches or databases, and renders a response.

  7. 7
    Browser 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.

Stages from Enter to first paint
Step 1 / 6
Browser
DNS
TCP
TLS
CDN / LB
App server
Database

STEP 1Parse the URL, check HSTS and the browser cache. A cache hit could stop here.

07

Where the time goes on a first visit (100 ms RTT)

Cold visit, no cached DNS or connections, TLS 1.3, HTTP/2

Step 1 / 5
StageRound tripsApproximate time
DNS lookup (cache miss)1-250-150 ms
TCP handshake1100 ms
TLS 1.3 handshake1100 ms
HTTP request + server work1 + processing100 ms + 50 ms
Download HTML, then CSS/JS2-3 more200-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.

08

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.com
09

Complexity and performance

Cold connection setup2-3 RTT

TCP + TLS 1.3 (+ DNS).

HTTP/3 with 0-RTT resumption0-1 RTT

Repeat visits.

Good TTFB target< 200 ms

Server plus network.

10

Trade-offs

Server rendering vs client rendering

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.

Caching vs freshness

Long cache lifetimes skip network stages entirely but risk stale content; use versioned file names for static assets.

11

Variants and related techniques

Repeat visit

DNS, connections, and assets are cached; often only one request for the HTML is needed.

Service worker

A script intercepts requests and can serve responses offline from its own cache.

12

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.

13

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).

14

Practice problems

ProblemDifficultyWhat it trains
Explain the flow in under 3 minutesEasyStructured answer.
Measure a real site with curl timingEasyStage breakdown.
Cut first-visit load time in half for a global audienceMediumCDN, HTTP/3, caching.