"What Happens When You Type a URL and Hit Enter" - Full Walkthrough
The iconic system design capstone question: Unify keyboard interrupts, HSTS, DNS resolution, ARP, TCP handshake, TLS 1.3, HTTP routing, DB query, and DOM rendering.
The Master 11-Stage URL Execution Pipeline 🚀
Complete synthesis of Phase 1 concepts in a single unified journey.
01.1. The Definitive Interview Structure
This question tests whether an engineer understands both the macro architecture and the micro-details. Structure your answer in 5 clean chronological acts:
Act I: The Browser & URL Parsing
- Browser parses
https://systemdesign.dev/topics. - Checks HSTS (HTTP Strict Transport Security) list to force HTTPS before sending a single plaintext byte.
- Checks the browser cache for a prior response to this URL.
Act II: Resolving the Address (DNS & ARP)
- Checks Browser DNS Cache, OS DNS cache,
/etc/hosts. - If missed, performs Recursive DNS lookup to get the Anycast IP.
- Uses ARP (Address Resolution Protocol) to find the default gateway router's MAC address on the local network.
Act III: Establishing Transport & Security (TCP + TLS)
- TCP 3-way handshake (SYN, SYN-ACK, ACK).
- TLS 1.3 cryptographic handshake (ECDHE key exchange + Certificate validation).
Act IV: Ingress, Server Compute & Storage
- Request hits Cloudflare edge CDN → AWS ALB → Microservice pod.
- Database reads row from memory cache or B-Tree index.
- Returns HTTP/2 multiplexed stream with
200 OK.
Act V: The Critical Rendering Path
- Browser constructs DOM (Document Object Model) and CSSOM (CSS Object Model).
- Computes Render Tree, runs Layout (reflow), and Paints pixels via GPU.
02.2. HSTS Preload — The Security Starting Point
Before the first network byte is sent, modern browsers check the HSTS Preload List — a hardcoded list of domains embedded in Chrome, Firefox, Safari, and Edge source code that must always be accessed over HTTPS.
Without HSTS preload, the very first request to a new domain could be HTTP (even if the domain supports HTTPS), allowing a SSL-stripping attack where a Man-in-the-Middle intercepts the first HTTP request and downgrades all subsequent traffic to plaintext.
For your domain to be on the preload list, you must:
- Serve a valid HSTS header:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload - Serve HTTPS on port 443 with a valid certificate
- Redirect all HTTP to HTTPS
- Submit your domain at
https://hstspreload.org
Removal from the preload list takes 6-12 months to propagate — this is a one-way door. Ensure all subdomains can serve HTTPS before preloading.
03.3. The Critical Rendering Path in Detail
The browser's rendering pipeline is a sequence of stages, each blocking the next:
- HTML Parsing → DOM: Browser incrementally parses HTML bytes into a Document Object Model tree. Blocking
<script>tags withoutasyncordeferpause parsing. - CSS Parsing → CSSOM: All CSS files are fetched and parsed into a CSS Object Model. Render-blocking — no pixels painted until CSSOM is complete.
- DOM + CSSOM → Render Tree: Combines structural DOM with styling CSSOM. Invisible elements (
display: none) are excluded. - Layout (Reflow): Browser calculates exact positions and sizes of every visible element on the viewport.
- Paint: Fills pixels — text, colors, images, borders are rasterized into bitmap layers.
- Compositing: GPU composites multiple layers (for CSS transforms, z-index) into the final frame buffer.
Time-to-First-Byte (TTFB) measures the wait before any HTML arrives. First Contentful Paint (FCP) measures when the first content pixel appears. Largest Contentful Paint (LCP) — the primary Core Web Vital — measures when the main content element finishes rendering (target: <2.5 seconds).
04.4. Service Workers & Subsequent Request Optimization
On subsequent visits, a Service Worker (a background JavaScript file registered by the PWA) intercepts all fetch requests before they hit the network. It can:
- Return a cached response instantly from the Cache Storage API (sub-1ms)
- Implement stale-while-revalidate: serve cached version immediately, update cache in background
- Enable full offline functionality by serving entirely from cache
Combined with:
- HTTP/2 Push /
<link rel=preload>: Pre-fetching critical resources before they're discovered in HTML - Long-term CDN caching of content-hashed JS/CSS bundles (
cache-control: immutable) - DNS pre-resolution (
<link rel=dns-prefetch href="//api.example.com">) to eliminate DNS lookup latency for API calls
A well-optimized returning visitor experience can achieve <100ms page loads with service workers serving from cache.
⚖️Architectural Trade-offs & Production Realities
Architectural Advantages
- Demonstrates holistic full-stack mastery across networking, OS, distributed systems, and browsers
Trade-offs & Constraints
- Easy to get bogged down in trivial details unless structured hierarchically
Netflix pre-resolves DNS, uses TLS session resumption, serves UI bundles from local edge Open Connect Appliances (OCA), and leverages server-side rendering to achieve <800ms initial screen render on Smart TVs.
🎯 Staff+ Engineering Takeaways
- The URL journey spans Browser → DNS → Transport (TCP/TLS) → Edge/LB → Backend/DB → Browser Render.
- HSTS Preload List prevents SSL-stripping attacks before the first network byte is sent.
- Critical Rendering Path: HTML/CSS → DOM/CSSOM → Render Tree → Layout → Paint → Composite.
- Service Workers enable <100ms repeat visits by serving from the browser Cache Storage API.
- LCP (Largest Contentful Paint) <2.5s is the primary Core Web Vital for perceived page load performance.
Topic Knowledge Assessment 🧠
Step through 2 scenario questions to test your staff-level grasp.
What is the purpose of the HSTS (HTTP Strict Transport Security) preload list stored inside modern browsers?
How clear and staff-actionable was this system breakdown?