July 20–24, 2015
Portland, OR

You type "google.com" into your browser bar and press enter: What happens next?

Graeme Mathieson (Wossname Industries)
11:30am–12:10pm Wednesday, 07/22/2015
Foundations D135/136
Average rating: **...
(2.75, 8 ratings)

Prerequisite Knowledge

Being a regular user of the internet and web browsers is almost essential, but other than that, just an interest in learning what happens behind the curtain!

Description

I have an interview question I rather like using. I can’t for the life remember who I stole it from — I had thought it was from an Amazon employee — but I can’t find a reference offhand. It’s a pretty simple question:

> When I type www.google.co into the location bar of my favourite browser and press return, what happens?

It’s a doozy of a technical question, I think. There are plenty of different areas and concepts involved, so it encourages a fun and interesting conversation. It gives me an idea of whereabouts in the stack the interviewee feels most comfortable (do they primarily talk about the server page generation, the intermediate communication, or the client side browser behaviour?) and their depth of knowledge in those areas. Finally, it tells me something of the candidate’s communication (and teaching) skills.

Plus I always learn something new. And when you’re interviewing, as Valve succinctly put it, you’re looking for a ‘T’ shape. Somebody who has a wide breadth of experience, but has depth of experience in one particular area. So it’s good to find somebody who can answer the breadth of the question and at least one area in some depth. (Ideally more depth than me because I want to learn!)

So, where to start? I find it helpful to think in terms of three different aspects:

  • The passing of time
  • The entities involved
  • The scale at which we’re examining the system

Looking at the time line at a very high scale, we get an accurate, but entirely superficial answer: the web browser goes to the BBC website, fetches the information for the page, and displays it to the user.

This presentation is my take on the answer, and will cover topics like:

  • How the browser interprets the string “google.com” and determines what it is you’re actually looking for
  • Resolving names into IP addresses with DNS, including an overview of UDP for sending DNS requests and receiving the responses
  • The application layer: how an HTTP request is constructed
  • The transport layer: how TCP works to create a reliable bi-directional stream of data between two hosts
  • The internet layer: how IP works to shuffle packets back and forth across the internet
  • The data link layer: how packets get from one (intermediate) host to another over a length or wire, or a wireless network
  • Back up to the application layer: how HTTP responses are constructed
  • Back to the browser, where the response is interpreted and the rendering engine kicks in.

It’s quite a whirlwind tour!

Photo of Graeme Mathieson

Graeme Mathieson

Wossname Industries

Graeme Mathieson builds cool stuff with Ruby for various people. His particular interest is in deeply learning the business domain, in order to help build better products.