What Happens When You Type a URL in the Browser: The Complete Answer
Last updated 2026-11-19
This is the most popular open-ended question in networking and backend interviews because one answer touches almost every subject: DNS, IP routing, ARP, TCP, TLS, HTTP, load balancers, caching and browser rendering. Interviewers listen for order and depth. A good answer goes in sequence, names the protocol at each step, and can zoom into any step on request.
This page breaks the journey into questions you can answer one at a time, then adds the timing arithmetic and the follow-ups interviewers like. For the supporting topics, see DNS interview questions, TCP/IP interview questions and HTTP and HTTPS interview questions. For the round-level plan read how to crack a computer networks interview.
| Order | Parse URL, cache checks, DNS, ARP, TCP, TLS, HTTP, server, response, rendering |
|---|---|
| Timing example | About 210 ms to first byte at 50 ms RTT with TLS 1.3 and a cold cache |
| Questions | 16 |
A two-minute spoken answer
The browser parses the URL and checks its caches and HSTS list. It resolves the host name to an IP address with DNS, then opens a TCP connection with a three-way handshake, using ARP on the local link to reach the gateway. For https it runs a TLS handshake. It sends an HTTP request, a load balancer or CDN routes it to a server, which returns a response, and the browser parses HTML, fetches CSS, JavaScript and images, builds the DOM and render tree, lays out and paints the page.
What Happens When You Type a URL in the Browser: questions with worked answers
1 Give the high-level sequence of events after you type https://www.example.com/page and press Enter.
easyOne: the browser parses the URL into scheme, host, port and path, and decides whether it is a URL or a search. Two: it checks caches (HSTS, DNS, HTTP). Three: DNS resolves the host to an IP address. Four: the OS prepares the packets, using ARP for the next-hop MAC address. Five: a TCP connection is established. Six: TLS negotiates keys. Seven: the browser sends an HTTP request. Eight: the server (usually behind a CDN or load balancer) produces a response. Nine: the browser renders the HTML and fetches subresources.
2 What does the browser do first with the typed text?
easyIt decides whether the text is a URL or a search query, based on whether it looks like a host name with a valid scheme or TLD. If it is a search it goes to the default search engine. For a URL it normalises it: adds the default scheme if missing, converts an internationalised domain name to punycode, and extracts the port (443 for https, 80 for http by default). It also checks the HSTS list and, if the host is on it, upgrades an http URL to https before any request is made.
3 Which caches are checked before the network is used?
mediumThe browser may have the whole response in its HTTP cache. If the cached copy is fresh (the Cache-Control max-age has not expired), no request is sent at all; if stale, a conditional request with If-None-Match is sent. A service worker may intercept the fetch. For the address, the browser's internal DNS cache, then the operating system cache and the hosts file are checked before asking a resolver. Each cache layer reduces the work at the next step.
4 Describe the DNS resolution step.
mediumThe OS stub resolver sends a query to its configured recursive resolver, typically over UDP port 53 (or DNS over HTTPS if the browser has it enabled). The resolver uses its cache, or walks from a root server to the TLD server to the domain's authoritative server, and returns an A or AAAA record with a TTL. If the name is a CNAME for a CDN the resolver follows the alias too. The result is cached by the resolver, the OS and the browser. See DNS interview questions.
5 Where does ARP come in?
mediumTo send an IP packet on Ethernet the host needs the MAC address of the next hop. If the server is not on the local subnet, the next hop is the default gateway, so the host checks its ARP cache for the gateway's MAC and, if absent, broadcasts an ARP request. The gateway answers. The frame carries the gateway's MAC as destination and the server's IP in the packet. Each router along the path repeats the lookup for its own next hop, and Wi-Fi hosts do the same over the access point. On IPv6 neighbour discovery replaces ARP.
6 How does the TCP connection get established, and what are the sockets?
mediumThe client picks an ephemeral source port and sends a SYN to server_ip:443. The server replies SYN-ACK and the client completes with ACK, taking one round trip before the client can send data. The connection is identified by the 4-tuple of source IP, source port, destination IP and destination port. Each router on the path decrements the TTL and forwards by longest prefix match, and NAT at the home router rewrites the private source address to its public one.
7 What happens in the TLS handshake?
mediumAfter the TCP handshake the client sends ClientHello with the server name (SNI), supported ciphers and a key share. The server returns its choice, its key share and its certificate chain. The client validates the chain to a trusted root, checks the host name and dates, and both sides derive the symmetric session keys. In TLS 1.3 this takes one round trip, TLS 1.2 takes two. All later data is encrypted. See HTTP and HTTPS interview questions.
8 Numerical: RTT to the server is 50 ms and DNS takes 60 ms in total. Estimate the time until the first byte of the response arrives (ignoring server processing) for a cold start with TLS 1.3, with TLS 1.2, and with HTTP/3 (QUIC).
mediumTLS 1.3 over TCP: DNS 60, TCP handshake 1 RTT = 50, TLS 1 RTT = 50, request and first byte 1 RTT = 50, total 210 ms. TLS 1.2: one more round trip in the handshake, so 260 ms. HTTP/3 over QUIC combines the transport and TLS handshake into one round trip: 60 + 50 + 50 = 160 ms. With a resumed connection and 0-RTT, the request goes in the first flight. With a persistent connection already open, only the 50 ms request round trip remains. Each round trip saved is worth 50 ms on this path.
9 What does the HTTP request look like and what does the server do?
mediumThe browser sends a request line such as GET /page HTTP/1.1 (or an HTTP/2 or HTTP/3 stream with the same semantics), with headers such as Host, User-Agent, Accept, Accept-Encoding and Cookie. The request reaches the site's edge: a CDN may answer from cache, otherwise a load balancer picks a back-end server, a web server such as nginx routes it to an application, which may query a database or cache, builds HTML or JSON, and returns a status code, headers and body.
10 What do a load balancer and a CDN contribute to this journey?
mediumA CDN places caches near the user: DNS or anycast directs the request to a nearby edge server, which returns cached static content immediately and forwards misses to the origin, cutting latency and origin load. A load balancer spreads requests over several application servers using round robin, least connections or hashing, runs health checks to avoid failed instances, and may terminate TLS. Both are why the IP address you reach is often not the origin server's.
11 What does the response contain and what happens to redirects and errors?
mediumA status line, headers (Content-Type, Content-Length or chunked encoding, Cache-Control, Set-Cookie, Content-Encoding such as gzip or brotli) and a body. A 301 or 302 with a Location header makes the browser restart the sequence for the new URL, possibly with a new DNS lookup and connection. A 4xx or 5xx response is displayed or handled by the page; 304 means use the cached copy. The browser decompresses the body and starts parsing as bytes arrive.
12 Explain how the browser renders the page (critical rendering path).
mediumThe HTML parser builds the DOM incrementally. Stylesheets are fetched and parsed into the CSSOM, and CSS blocks rendering because styles must be known. A script without async or defer blocks the parser until it has downloaded and run, since it can change the DOM. DOM and CSSOM combine into the render tree (only visible nodes), then layout computes sizes and positions, paint draws pixels into layers and the compositor combines them on screen. Changing layout-affecting properties later triggers reflow, and images and fonts that arrive late can shift the layout.
13 How are the other resources of the page loaded, and what speeds that up?
mediumWhile parsing, a preload scanner finds image, script and stylesheet URLs, and the browser requests them in parallel. Over HTTP/2 or HTTP/3 these share one connection through multiplexing, while on HTTP/1.1 up to about six connections per host are used. Speed-ups include caching headers, compression, a CDN, preconnect and preload hints, lazy-loading images, defer on scripts, and minimising critical CSS.
14 What if the site is only on HTTP and the user typed no scheme?
hardBrowsers now try https first for typed hosts without a scheme and fall back to http if the connection or handshake fails. A plain http request is sent in clear text, so a network attacker can read or modify it, and an HSTS entry cached from an earlier visit would block the downgrade. A server redirecting http to https with a 301 still exposes the first request, which is why HSTS preload lists exist. See network security interview questions.
15 What changes if the user is behind a corporate proxy or VPN?
hardThe browser (or the OS or a PAC file) sends requests to the proxy instead of directly. For http the proxy gets the full URL; for https the browser sends CONNECT host:443 and the proxy tunnels the encrypted bytes, unless it intercepts TLS with a company-installed root certificate. DNS may be done by the proxy. With a VPN, packets are encapsulated to the VPN gateway and the corporate DNS may answer internal names, so the same name can resolve differently on and off the VPN.
16 If the page does not load, how do you debug it layer by layer?
hardCheck each stage in order: does the name resolve (dig or nslookup), is the host reachable (ping, traceroute), does the port accept connections (curl -v or nc -vz host 443), does TLS succeed (curl -v shows the certificate, openssl s_client), what status does HTTP return (curl -I), and are there client errors in the browser developer tools network and console tabs. The failing step tells you whether the fault is DNS, routing, a firewall, a certificate or the application.
bashdig +short www.example.com nc -vz www.example.com 443 curl -v -o /dev/null https://www.example.com/ openssl s_client -connect www.example.com:443 -servername www.example.com
Frequently asked questions
How long should my answer to this question be?
Start with a two-minute overview covering DNS, TCP, TLS, HTTP and rendering in order, then stop and let the interviewer pick a step to expand. Prepare a deeper minute for each of those steps.
Does the answer change for HTTP/3?
Yes: it uses UDP and QUIC instead of TCP and a separate TLS handshake, so connection setup takes one round trip and loss on one stream does not stall the others. The DNS, server and rendering steps are unchanged.
Where is the IP address of the destination found?
In the DNS response, which the browser stores and uses as the destination in every packet. Routers only look at it, and use the next-hop MAC at each link.
What is different for a single-page app?
The first load fetches a small HTML shell and JavaScript bundles; the app then renders in the browser and makes further API calls with fetch. Later navigation changes the view without a full page load.
Related guides
- DNS Interview Questions: Resolution, Record Types, Caching and Troubleshooting
- HTTP and HTTPS Interview Questions: Methods, Status Codes, TLS and Caching
- TCP/IP Interview Questions: Handshake, Congestion Control and Numericals
- TCP vs UDP Interview Questions with Socket Code and Numericals
- OSI Model Interview Questions: Layers, PDUs, Devices and Encapsulation
- Computer Networks Interview Questions with Worked Answers and Numericals
- Network Security Interview Questions: Cryptography, Firewalls and Attacks
More in CS Fundamentals Interview Questions
- Abstraction and Encapsulation Interview Questions
- Cache Memory and Computer Organization Interview Questions with Numericals
- Caching Interview Questions and Answers
- Cloud Computing Basics Interview Questions with Answers
- Computer Architecture Interview Questions with Numericals
- Computer Networks Interview Questions with Worked Answers and Numericals
- CPU Scheduling Interview Questions with Gantt Chart Numericals
- Database Indexing Interview Questions
- DBMS Concurrency Control Interview Questions
- DBMS Interview Questions and Answers
- DBMS Keys Interview Questions
- Deadlock Interview Questions with Banker's Algorithm Worked Example