Web5 min read10 interview questionsNew · November

What happens when you open a web page

From typing an address to seeing the page, in five steps.

In one sentenceYour browser looks up the address, connects to a computer far away, asks for the page, and draws what comes back.

Think of it like thisIt is like looking up a friend in a phone book, calling them, asking for a recipe, and writing it down as they read it out.

The big picture

Tap any step to see where to use it, how to use it and an example result.

Names become numbers

Computers talk using numbers called IP addresses. DNS is the system that turns a name like uyron.in into one. Your browser asks a DNS server, and remembers the answer for a while so it does not have to ask again.

A secure connection first

Before any page is sent, your browser and the server agree on a secret key, so nobody in between can read the conversation. This is what the padlock in the address bar means.

Request, response, then more requests

The browser asks for the page. The server sends back HTML. The HTML points to styles, scripts and images, so the browser makes more requests for those, then puts everything together on the screen.

  • HTML says what is on the page
  • CSS says how it looks
  • JavaScript says how it behaves

Common mistakes

  • Thinking a page is one file. A single page often needs dozens of requests.
  • Forgetting that DNS changes can take time to spread around the world.
  • Blaming the server when the slowness is in a large image or script.

Quick recap

  • DNS turns names into IP numbers
  • A secure connection is set up before data is sent
  • The browser asks, the server answers with HTML
  • The page needs many more requests for styles, scripts and images

Try it yourself

Open your browser's developer tools (press F12), choose the Network tab, reload any page and count how many requests it makes.

Top 10 interview questions

Ordered from basic to advanced. Try answering out loud first, then open the answer.

  1. What happens when you type a URL into a browser and press Enter?Basic

    The browser looks up the server's IP address using DNS, opens a connection to it (usually secured with TLS), sends an HTTP request, receives the HTML, and then fetches the CSS, JavaScript and images the page needs before drawing it on screen.

  2. What is DNS and why is it needed?Basic

    DNS is the internet's phone book. People remember names like example.com, but computers route traffic by IP address, so DNS translates the name into the address.

  3. What is an IP address?Basic

    A number that identifies a device or server on a network so data knows where to go. IPv4 looks like 203.0.113.10; IPv6 addresses are longer and exist because IPv4 addresses ran short.

  4. What is the difference between a browser and a web server?Basic

    The browser is the client that asks for pages and displays them. The server is a program on another computer that stores or builds the pages and answers those requests.

  5. How does DNS resolution work step by step?Intermediate

    The browser checks its own cache, then the operating system, then asks a recursive resolver (often your ISP's). If the resolver does not know, it asks a root server, then the top-level domain server (.com), then the domain's authoritative server, and caches the answer for the time set in its TTL.

  6. What is the TCP handshake and why does it matter?Intermediate

    Before sending data, the client and server exchange SYN, SYN-ACK and ACK messages to agree they are both ready. It makes the connection reliable, but it costs a round trip, which is why connection reuse and newer protocols like HTTP/3 try to reduce it.

  7. What does TLS add to the connection?Intermediate

    Encryption and identity. The server shows a certificate proving who it is, both sides agree on keys, and from then on the traffic cannot be read or changed by someone in the middle. This is the padlock in the browser.

  8. Why does the browser make so many requests for one page?Intermediate

    The first response is only the HTML. It references stylesheets, scripts, fonts and images, and each of those is fetched separately. Fewer, smaller and cached files make the page faster.

  9. Which things can make a page load slowly, and how would you find out which one?Advanced

    Slow DNS, slow server response, large images, blocking scripts, or too many requests. I would open the browser's Network tab and look at the waterfall to see which request starts late or takes long, then measure server time separately from download time.

  10. How do CDNs, caching and HTTP/2 or HTTP/3 improve this whole journey?Advanced

    A CDN serves files from a location near the user, caching avoids repeat downloads, and HTTP/2 and HTTP/3 send many requests over one connection and cut the setup delay. Together they reduce the distance, the number of trips and the waiting.

Back to Learn Hub

Guides are simplified on purpose. Tool names and details change, so check the official documentation before relying on a detail.