What happens when you type a URL and press Enter? Give me the version you would give in a campus viva, then tell me where you expect me to push.
Six steps in order: the browser checks its cache, DNS resolution turns the hostname into an IP address, a TCP handshake opens a connection, a TLS handshake authenticates the server and agrees keys, an HTTP request fetches the page, and the browser renders it. Panels push on DNS, the handshakes and certificates.
Answer
Short answer
It is six steps, each depending on the one before. The browser parses the URL and checks its cache. DNS resolution turns the hostname into an IP address. A TCP handshake opens a connection to port 443, a TLS handshake authenticates the server and agrees encryption keys, an HTTP request fetches the page, and the browser parses and renders it, fetching images, scripts and styles the same way.
Was this answer helpful?
Likely follow-ups
- The DNS answer is cached. Name every place it could be cached between your browser and the authoritative server.
- Why would two packets not be enough to set up a TCP connection?
- Your laptop has the server's IP address. How does the first packet reach your router on the local network?
- What does the browser do if the certificate is valid but issued for a different hostname?
Related questions
- Which status codes and method semantics do you insist on in a code review, how do the caching headers fit together, and is the API you just described REST?mediumAlso on http6 min
- Two clients open the same record, both edit it, and the second save silently overwrites the first. How would you use ETags to turn that lost update into something the client can see and handle?mediumAlso on http4 min
- Your logs are full of Cannot set headers after they are sent. Walk me through how a request gets into that state.mediumAlso on http4 min
- How do you design the error contract for an API that other teams have to program against?hardAlso on http6 min