Debuggingcapstoneinterviewtype a urldnstcp

Capstone: What Happens When You Visit https://example.com

The canonical networking interview question is a test of whether you can tell the story at the right altitude — nine steps in a minute, twelve layers on request, and at every layer the mechanism, the state that changes, and the failure you would name.

ConceptualBrowserLinux

The problem

An interviewer says "walk me through what happens when you type https://example.com and press Enter". Ten minutes, no whiteboard. Where do you start, how deep do you go, and how do you show you can debug it rather than recite it?

Level 1: the nine-step story in sixty seconds

Start at the altitude where every step is a noun the interviewer recognises and the chain is complete: the browser parses the URL; DNS turns the name into an IP; the OS routes toward that IP; TCP opens a connection; TLS secures it and proves the server’s identity; HTTP asks for the page; the server produces a response; the response comes back and the browser renders it. Say it in one breath, then stop and let them choose where to zoom. The stopping is the skill: a candidate who dives into TCP window scaling before finishing the story has shown they cannot summarise.

The "open a website" journey renders this same chain with four zoom levels, and the interactive here lets you expand any rung into its sub-steps and inject a failure at each — the way an interviewer will.

Level 1 — the mental journey every answer must complete
  1. URLscheme `https`, host `example.com`, default port 443, path `/`
  2. DNSbrowser cache → OS → resolver → authoritative; an A/AAAA record
  3. IPa destination address; the packet has a source and a destination
  4. Routingdefault gateway, then longest-prefix match hop by hop
  5. Transport connectionTCP three-way handshake (or QUIC over UDP for HTTP/3)
  6. TLSClientHello with SNI, certificate, key agreement; one RTT on 1.3
  7. HTTPGET / with Host and headers; HTTP/2 over the same connection
  8. ServerLB → app → database → response body
  9. Responsestatus, headers, body; the browser parses and renders, then fetches more

Level 2: twelve layers when they ask for more

When the interviewer says "go deeper", the second ladder adds the layers the first one skipped: the socket API and the kernel between browser and network, the link layer between IP and the router, and the return trip. Now each rung has a mechanism to name: socket()/connect() and the descriptor; the kernel’s TCP state machine and buffers; the IP header with TTL; ARP or neighbor discovery to find the gateway’s MAC; the Ethernet or Wi-Fi frame; NAT at the home router rewriting the source; BGP-chosen paths across autonomous systems; the destination’s NIC, kernel, accept(), and the process.

At this altitude the interviewer is listening for which state changes where: DNS caches populated, a socket in SYN_SENT then ESTABLISHED, a NAT table entry, sequence numbers advancing, a TLS session key, a keep-alive connection left open for the next request. Follow a Web Request Through Every Layer and Follow One Packet trace these state changes explicitly; Follow send() Through the OS to recv() covers the kernel half.

Level 2 — the advanced ladder, with the OS and link layers made explicit
  1. BrowserURL parse, HSTS check, cache check, connection pool lookup
  2. Socket`socket()`, `connect()`: a descriptor and a kernel TCP control block
  3. Kernelsend buffer, TCP state machine, timers; the syscall boundary
  4. TransportSYN with ISN, MSS, window scale; later segments with seq/ack
  5. IPsrc/dst addresses, TTL 64, DF bit; routing-table lookup for the next hop
  6. Ethernet / Wi-FiARP/ND for the gateway’s MAC; a frame with src/dst MAC
  7. Home routerNAT: rewrite src IP:port, record the mapping; decrement TTL
  8. InternetISP → transit/peering → destination AS; BGP path; each hop swaps MACs and decrements TTL
  9. Destinationedge / LB terminates TCP; SYN-ACK; `accept()` wakes a process
  10. TLSSNI selects the certificate; chain verified; session keys derived
  11. HTTPrequest framed (HTTP/2 stream), routed by Host/path
  12. Applicationhandler runs, database queried, response serialised and sent back down the same stack

How to answer progressively, and what they listen for

Answer in rounds. Round one is the nine-step story with no detail — sixty seconds. Round two, on request, expands one rung they pick, to the level-2 mechanisms, naming the state that changes. Round three, if they keep pushing, is internals: SYN cookies, TLS 1.3 key schedule, HTTP/2 HPACK, epoll on the server. You do not choose the rung; they do, and following their choice cheaply is what distinguishes understanding from recitation.

At every layer, be ready with three things: the mechanism (what happens), a number (how long it takes, how big it is), and a failure (what breaks here and what it looks like). "TLS handshake — one round trip on 1.3, two on 1.2, so ~30 ms in-region; fails as an expired certificate, a hostname mismatch or a missing intermediate that browsers hide and curl exposes" is a complete answer for that rung. A candidate who can name the failure at each layer has clearly debugged it, and that is what the question is for.

Per layer: what interviewers listen for, a number to anchor it, and the failure to name
LayerWhat they listen forA numberFailure to name
URL / browserScheme → port 443; HSTS; cache and connection reuse before any network0 ms if cachedHSTS forcing HTTPS on a host without a cert
DNSCache chain; recursive vs authoritative; TTL; A vs AAAA~1 ms cached, 20–100 ms coldNXDOMAIN, stale cache after a change, split-horizon
Routing / IPDefault gateway; longest-prefix match per hop; TTL decrements; NAT at the edge~10–15 hops, TTL 64 → ~50No route to host; NAT table exhaustion; MTU black hole
LinkARP/ND finds the gateway MAC; MACs change each hop, IPs do not1 ARP round trip on a LANWrong gateway; ARP failure = "destination host unreachable"
TCPSYN/SYN-ACK/ACK; ISN; window; slow start; HOL blocking1 RTT to connectTimeout (dropped) vs refused (RST); backlog overflow
TLSSNI; certificate chain to a trusted root; key agreement; 1.3 = 1 RTT1 RTT (1.3), 2 (1.2)Expired cert, name mismatch, missing intermediate, clock
HTTPRequest line, Host, headers; status codes; HTTP/2 multiplexing; keep-alive1 RTT + server time502/503/504 and which hop wrote them; 4xx as client faults
ServerLB → app → DB; accept(); worker model; the timeout ladderp50 20 ms, p99 200 msSlow query → 504; crash → 502; health check flip → 503
Response / renderSame path in reverse; browser parses HTML, fetches assets over the same connectionoften 20–100 more requestsMixed content, blocked assets, a CDN miss

The return path and what happens after the first byte

Half-answers stop at "the server sends the response". Complete it: the response travels the reverse path — but not necessarily the reverse route, since each direction is routed independently — through the NAT mapping the outbound packet created, into the client’s kernel receive buffer, and up to the browser through the same socket. Then the browser parses HTML, discovers stylesheets, scripts and images, and issues a dozen or a hundred more requests, multiplexed on the same HTTP/2 connection (or on a small pool of HTTP/1.1 connections), most of them to a CDN whose DNS answer put an edge server a few milliseconds away. The first page load is dominated by round trips — DNS, TCP, TLS, then request — which is why Where the Time Goes: The Request Timeline is mostly about counting them.

End with the cross-domain picture if invited: the server side is a process the OS scheduled, reading from a socket via epoll, hitting a database whose buffer pool may or may not have the page — Capstone: A Server With 50,000 Concurrent Connections and Capstone: Three Seconds from Warsaw are the OS and together versions of this same walk.

  • Return route ≠ reverse of the forward route; NAT mapping from the outbound packet lets the reply in.
  • The first request is RTT-bound: DNS + TCP + TLS + HTTP ≈ 3–4 round trips before the first byte.
  • Subsequent assets reuse the connection; the CDN’s DNS answer decides how far they travel.

What weak answers do

They skip DNS or say "the browser looks up the IP" without saying where. They say "the packet is sent to the server" with no routing, no gateway, no NAT. They confuse TCP with TLS, or put the TLS handshake before the TCP one. They describe HTTP as "the request" without a method, a Host header or a status code. They say "the server processes it" and stop. And they cannot name a single failure at any layer, which is the difference between having read about the stack and having debugged it. The Why Can’t I Connect? ladder is this lesson’s debugging twin: every rung there is a failure to name here.

  • Do: complete the chain first, expand on request, give a mechanism + a number + a failure per layer.
  • Do not: start at the deepest layer you know; skip DNS or routing; confuse TCP and TLS ordering; stop at "the server responds".

Key points

  • Tell the nine-step story first — URL, DNS, IP, routing, transport, TLS, HTTP, server, response — then expand only where asked.
  • The advanced ladder makes the OS and link layers explicit: socket, kernel, IP, Ethernet/Wi-Fi, router/NAT, internet, destination.
  • At each layer give a mechanism, a number and a failure; naming failures proves you have debugged it.
  • The first byte costs ~3–4 round trips (DNS, TCP, TLS, HTTP); the rest of the page reuses the connection.
  • The return route is independent of the forward route; NAT state from the outbound packet admits the reply.
  • Weak answers skip DNS or routing, misorder TCP and TLS, and stop at "the server responds".

Why does this exist?

Mechanisms are answers to constraints. Open each question before reading the answer.

Why do interviewers keep asking this question?

It is the only question that touches every layer, has no single right depth, and exposes whether the candidate can choose an altitude, follow a prompt to zoom, and connect mechanisms to failures they have seen.

Why answer in rounds instead of dumping everything?

The interviewer has a specific layer they care about, and a complete overview lets them steer there. Front-loading detail hides the overview and wastes time on layers they were not going to probe.

Why a failure per layer?

Failures are where understanding is tested in practice. A layer you can break in your head is a layer you can debug in production; a layer you can only describe is a layer you have read about.

Capstone: visiting a URL

Capstone: what happens when you visit https://example.com?
Build the answer level by level. A level-1 answer names the chips; a senior answer expands each one and names how it fails.
Level 1 — click a chip to expand it
Coverage: 0 of 9 layers expanded0
Naming the chips is the level-1 answer everyone gives. The interview starts when you are asked to open one.
Progressive answer preview
The browser parses the URL: scheme https means port 443.
DNS turns example.com into an IP address.
The client picks an address to connect to.
Packets are forwarded router by router toward that address.
TCP sets up a reliable connection with a three-way handshake.
TLS negotiates encryption and proves the server's identity.
The browser sends GET / and the server answers with a status and a body.
A server process handles the request and builds the response.
The response travels back and the browser renders it.
DNScollapsedConceptual
Level 1
DNS turns example.com into an IP address.
Advanced sub-steps
  1. Browser cache → OS resolver cache (getaddrinfo) → /etc/hosts
  2. Stub resolver asks the recursive resolver (from DHCP/VPN config) over UDP 53 / DoH
  3. Recursive resolver walks root → .com → authoritative if not cached; answers carry a TTL
  4. A and AAAA queried in parallel
What interviewers listen for. The cache hierarchy, and that the recursive resolver does the walking, not your laptop.
Which failure to name here. NXDOMAIN (name missing) vs SERVFAIL (resolver broken) vs timeout (UDP 53 blocked); stale records after a migration until the TTL expires.

How it fails

What the failure looks like from inside real software.

  • Starting with TCP congestion control and running out of time before mentioning HTTP.
  • Saying "DNS resolves the name" with no idea that the browser, OS and resolver each cache it separately.
  • Placing TLS before TCP, or omitting SNI and then being unable to explain how one IP serves many certificates.
  • Describing routing as "the packet goes to the server" and being unable to say what changes at each hop.
  • Having no failure story at any layer — an answer that would not help during an outage.

Follow it through every layer

This lesson is one node of a longer journey. Zoom out, then zoom back in.