22 ms·
“What happens when you type Google.com into your browser and press enter?”
- kyled 12y agoMaybe it's a test to see how well you can communicate? I would of given a very brief high level overview, such as... A request is sent to Google's severs for their "new search" page. Google then responds with the necessary data in order for your Web browser to display the Web page . There's a lot more to the full story, but I can go into detail if you would like. I would offer diving into the important parts related to the position.
- felipesabino 12y agoThere is also a very good introductory answer in this subject by Jean-Baptiste Quéru in 2013 [1] where he takes the revers approach of when the page is displayed, then talks about connection, OS, etc. "simplifying" the answer and going down several levels of abstraction and complexities to give the proper overwhelming sense that this question should impose. It is a very fun text to read and I really recommend it. [1] https://plus.google.com/u/0/+JeanBaptisteQueru/posts/dfydM2Cnepe https://plus.google.com/u/0/+JeanBaptisteQueru/posts/dfydM2C...
- wldcordeiro 12y agoWhen I first read the headline I thought of this post as well, my instinct was that someone had pasted it into a Gist but it seems like a collaborative project to make an even more detailed answer. Which is neat.
- spinchange 12y agoCame here to recommend that post also. Probably the best thing I've ever seen on Google+.
- avmich 12y agoI'd like to see a detailed description of sockets work.
- imaginenore 12y agoThe first part is already outdated. A lot depends on the browser. Chrome will look up stuff as you type it, and by the time you press <enter>, the DNS lookup will likely have happened already. And, likely, the actual request to the page. It's probably even more complicated than that, I believe "google.com" is a very special case in Chrome.
- egypturnash 12y ago> The keyboard controller then encodes the keycode for transport to the computer. This is now almost universally over a Universal Serial Bus (USB) connection, but historically has been over PS/2 or ADB connections. What about Bluetooth keyboards?
- kevan 12y agoOoh, now we can add a big section on EMR, wireless protocols, forward error checking, the possibilities are endless!
- Florin_Andrei 12y agoNah, it always ends with Maxwell's equations.
- cursork 12y agoLove it! One of my favourite bad interview questions. I got asked this in an interview ~5 years ago. My response was to look shocked... Pause. Then ask: "What do you mean? What detail do you need? DNS? SYN / ACK? HTTP?" At the point I started talking about syn/acks they just cut me off and moved on to the next question. Same company (different person) started the phone screen with 'oh so your CV says you know linux, what's the difference between a hard link and a soft link' and was shocked when I knew the answer, declaring the rest of the phone interview pretty pointless - he'd obviously had a bad morning and started with his hardest question. I've now learnt to see such interview questions as a sign of a workplace with little-to-no learning on the job. Most places that actively encourage learning don't try such things.
- senorprogrammer 12y agoI'm not so sure it's a bad interview question. Or rather, perhaps it's only bad if you, as the interviewer, have a specific answer in mind. We used it once with the caveat that "there's no right answer, we don't really know every step either, lets see what happens". We collaborated with them, it was great, and by the end of the conversation were pretty certain we wanted to keep the conversation going by hiring them. Set your expectations accordingly, I suppose.
- simpleigh 12y agoI agree with this completely. I think the point of all interviews should be to start a conversation - and the sort of broad technical conversation this question inspires is a really good way to see both what candidates know and how they communicate it. I've had candidates fail to explain the distinction between the client and the server. I had one candidate exclaim "I hoped you'd ask this" and jump straight into a discussion on the parsing of cache-control headers by proxy servers.
- cursork 12y agoThat's only superficially the same. There's questions and there's "let's work through this" questions. The latter are awesome when explicitly stated as such and can be (should be?) as hard as you want to make them - I find I learn from them whatever happens.
- hadrian 12y ago"I don't normally watch github projects, but when i do, it's projects like these :D "
- felipesabino 12y agoComputerphile made a good vide on the same subject ~a month ago called "What Happens When You Click a Link?" [1] It is obviously not as deep in content as the article is aiming to be, specially because it focus only on the first things that happens like DNS resolving and the socket connection, however, it is still fun video. [1] https://www.youtube.com/watch?v=keo0dglCj7I https://www.youtube.com/watch?v=keo0dglCj7I
- sufianrhazi 12y agoI hope people don't study this. The answer to this question doesn't matter. The whole point of this question is to (1) gauge the clarity of the candidate's communication when explaining complex systems and (2) have them get to a place where they simply doesn't know and must start making assumptions of how things work and weigh the various tradeoffs. That's where things get interesting.
- robertcope 12y agoI didn't know this was so popular of a question. I've been asking it for many years. I love it because anyone with expertise in any part of the system should be able to answer it. Are you a networking guru? If so, you should be able to talk a long time about the network bits. Are you a kernel guru? Same. Etc. It also gives me a good idea how broad the interviewee is. It is always amazing to me how many people fail the question so badly. I've really had only one person answer it reasonably in all these years.
- RogerL 12y agoSo, everyone fails and you think it is a good question? That doesn't make a lot of sense to me. I can't reasonably answer the question, because I haven't really needed to know it. When I need to know it, I'll learn it, and quickly. How is that question a good measure of me if you are not hiring me to architect a router or something where it pertains? I could ask you questions in my domain that you'd be hopeless at answering. But I wouldn't, because it would be a horrible measure of you.
- matthewmacleod 12y agoThe parent clearly said "so many people" and not "everyone" - that's a really important difference! I really struggle to believe that a competent software developer would be unable to answer this question with some degree of accuracy. It's not like it's a networking question - it's fantastically open-ended and covers everything from hardware, operating systems, networking, GUIs... and that's useful flexibility. On top of that, it's useful to help judge communication skills - engineers must be able to clearly express ideas, understand the audience that they're communicating with, and be able to discuss and reason with other engineers. I would not hire an engineer who was not able to answer this question.
- RogerL 12y agoHe said "really had only one person answer it reasonably in all these years ". Are we going to quibble about this wording? Let's see. I've done flight software. I've done cancer statistic software for the NIH. I've done autonomous robots and UAV. I've done drones. I've done weapons systems for the military. I've done mapping applications back on 486 machines with 16 bit software (hard to be responsive in that environment). I've design/built/debugged circuit boards. I've disassembled compilers and sent bug reports back to the manufacturer. I've done machine vision and computer vision. I've done simulation, solved partial differential equations, built bayesian filters. But, you know, I haven't had to do anything significant with resolving google.com. I mean, I know that it resolves to something like 145.234.34.45, I know there is a difference between TCP and UDP, and a few other things, but I pretty much just need to open sockets once in a while. I'm pretty much the goto person for hard problems whereever I've worked. I've written articles, and am writing a book. How does not knowing some specific fact make me unhirable? "there are no good engineers". Well, I guess there is one, since one person was able to answer the question.
- mattdesl 12y agoEven something as simple as the images and rectangles composited in hardware/software with Skia would take a thesis to explain.
- stfp 12y agoJust thought I'd point out that this is an old repo from 2013. Probably should update the title before people starting submitting PRs in a doomed attempt to "not skip on anything".
- bbarn 12y agoThe author just merged in a PR from (I'm guessing) an HN reader a few minutes after adding it.
- ph0rque 12y agothe time-to-live value for a datagram reaches zero at which point the packet is dropped Someone should write a Victorian-style novel on the hard, short, but virutous life of a packet.
- praptak 12y agoOr a multilevel story-within-a-story type where the browser tells the HTTP server a story about an OS who tells a story about keyboard interrupts and network packets and so on.
- _almosnow 12y ago>17.78 mA of this current is returned on either the D+ or D- pin (the middle 2) of the keyboard's USB connector. Oh, so we will look at it at THAT level of detail, nice. Then hardware interrupts, seems ok... Then HSTS and DNS, yeah, no, you are skipping like 3 more pages of things that happen in between. Good luck with your naive experiment.
- davegonzalez 12y agoIsn't that the point of having others help and fill in the gaps? What's the point of belittling it to a "naive experiment"?
- jodrellblank 12y agoMy browser runs on a smartphone with a software keyboard. Instant smug assumption fail.
- Animats 12y agoSo far, nobody has filled in the section on how a key-press event works its way through the OS, up to the window system, to the application, and to the code handling the input text box. Then there's what's happening at the Google end. Before search personalization, popular queries ("google", "Britney Spears") were handled by caches the first Google machine you talked to, and never even reached the search engine. Since search personalization, there's some cookie traffic, and then your personal dossier is retrieved from storage at Google for use in interpreting your query. Then, in the middle, your query probably travels through five to ten routers (try a traceroute) just to get to Google. Packets move from local Ethernet or WiFi to DSL to fiber to bigger fiber to gigabit Ethernet within a Google data center. And where is "google.com" for you? That's hard to find out. For me, today, it's at "nuq04s19-in-f14.1e100.net", wherever that is. My connection routed from Silicon Valley to Santa Rosa to San Jose before reaching a Google point of presence at Equinix in San Jose. Somebody also needs to talk about what's happening in the CPUs, with 3 billion or so instructions per CPU core every second, all devoted to looking up a cat video for you. When you play a cat video, more computation occurs than was done in the history of the world prior to 1940.
- bbarn 12y ago"So far, nobody has filled in the section on how a key-press event works its way through the OS, up to the window system, to the application, and to the code handling the input text box." That in itself is a multi-year discussion. From silicon chemistry theory, voltage biasing different types of substrates, the definition of ground, all the way to sofware control loops, eventing, software emulating parallellism, all the things happening and just waiting to happen on a single OS before you even press "g" on the keyboard will blow most people's minds away.
- com2kid 12y ago> So far, nobody has filled in the section on how a key-press event works its way through the OS, up to the window system, to the application, and to the code handling the input text box. Heck USB was glossed over. That section alone should be at least 3x longer!
- Florin_Andrei 12y ago
- bbarn 12y agoBy far my favorite question to ask (and be asked) in an interview. As others point out, it's practically impossible to understand the entire system. At one point or another in my career I've been exposed to at least descriptions of most of the components, but if I wanted a processor engineer, I'd be looking for a different answer than a web developer, or a networking guy, etc. Essentially anyone involved in the modern world of IT has to be able to answer something they're good at - and more importantly, admit the parts they don't understand. You can't cheat your way through the question, hell, you could even know it's coming and you still can't "beat" it. You don't know if I'm looking for hyper-detail about something, business sense to skip over irrelevant (to the position) details of a certain level, etc.
- tonyedgecombe 12y agoAn experienced developer is almost certainly going to start by asking you more questions, trying to find out what your expectations are.
- dead10ck 12y agoWow, judging from the comments in here, there are a lot of people that are in management positions that are horrible judges of technical ability and value. This question asks so many things that it doesn't really ask anything at all. No matter which field they decide dive into, if they can dive into any at all, it sheds no light whatsoever on their ability to solve problems, or their ability to learn new difficult concepts. Moreover, making assumptions about where their specialties lie because of the topic they chose to answer in is wrong--if they answered well, they could be skilled in many other topics as well, and if they didn't, that doesn't mean they're incompetent--it means they didn't know how to answer what is essentially a trick question.
- MichaelMoser123 12y ago>it sheds no light whatsoever on their ability to solve problems, or their ability to learn new difficult concepts. This is of course correct; one way to check for these is to ask specific questions for prior job experience; however the top-dog companies like to hire promising graduates right out of college and so they don't wish to cut them off by asking these questions.
- eblume 12y agoThis question always reminded me of the (excellent) book "Zen and the Art of Motorcycle Maintenance". The author explores the philosophy of engineering as being the art of separating things in to their components. At the risk of spoiling some of the book, a major struggle the author goes through is the paradox that there seems to be an infinite number of ways to split some kinds of systems, with no productive work ever being done. This question feels like that... you can split it down to the tiniest discrete system and you'll find you haven't gained much. That's not to say that you wouldn't gain SOMETHING, nor that it's a bad interview question. I actually like it. It's just not terribly productive, in an engineering sense.
- ekianjo 12y ago> that there seems to be an infinite number of ways to split some kinds of systems Indeed、you can even go to the electron level to describe what's happening in the circuitry and how it interacts with the silicon to propagate signals... it's never ending.
- runeks 12y agoGood point. Reading this article, it also crossed my mind that the level of detail is always arbitrary. There is no "right" level of detail, that explains everything. We can keep going infinitely more into detail, explaining each step in more and more detail. This article could just as well have included an explanation of how and why electrons travel from one point to another, or "the quantum effects that govern this" (a figurative example). A metaphor for this that references the world of electronics is the ability to always increase the resolution of a display. We can keep going on, although the human eye might not be able to pick up a difference after a certain point. Perhaps there is also a limit to the usefulness of increasing the level of detail in an explanation, as this article does, just as there's a limit to the usefulness of increasing display resolution.
- bobajett 12y agoI would really like to know what happens when Im driving down a highway at say 60mph and browsing the web on my smartphone (or well let's say my wife is doing the driving and Im browsing the web :-) ). What kind of communication is happening between me and the cellphone towers? What data is my phone sending to the different cellphone towers as I drive by them? How does the cellphone tower send that data to the internet? Does someone have a good pointer to a resource that would answer these questions?
- tinco 12y agoAlmost everything is exactly the same as on your desktop computer. The only thing that's different is what goes on under your TCP/IP layers. Your Phone has a modem built in, that modulates a digital signal over a carrier wave at a certain frequency (set of frequencies, depending on the channel access protocol) the modulated carrier wave is sent out to the cellphone tower. When the modem is supposed to receive, when it's allowed to send, how it negotiates these things is all strictly defined by protocols the telecom industry has standardized on. I can't say I'm an expert on these protocols, there's a whole bunch of them. They are grouped in protocol stacks with familiar names like GPRS, EDGE, UMTS, LTE. These protocols besides making optimal use of their available bandwidth taking into account all kinds of noise, disturbances, moving from tower to tower, other phones also specify how the communication should be encrypted. The encoding/decoding of these protocols is usually done by an integrated circuit in your phone that's separate from the rest of the phone's functionality, to prevent you from tampering with it (and to ensure reliability I guess). So all your phone's general operating system has to do is interface with that circuit to get neat IP packets.
- nandemo 12y agoLike tinco said, above TCP/IP it's pretty much the same as on your desktop. If you want to know about TCP/IP and below, I suggest this title: "From GSM to LTE-Advanced: An Introduction to Mobile Networks and Mobile Broadband". http://www.amazon.com/From-GSM-LTE-Advanced-Introduction-Broadband/dp/1118861957/ref=tmm_hrd_title_0 http://www.amazon.com/From-GSM-LTE-Advanced-Introduction-Bro...
- droopybuns 12y ago
- a3_nm 12y agoWouldn't it be more convenient for people to contribute if this were set up as a wiki?
- nzealand 12y agoHis emphasis on lower level protocols is not what I would expect a python programmer. I wonder what the following would say about me in an interview situation... Device specific rendering. Localization and Language logic. Image download and display. Screen rendering. Caching, cookies & browser history. Analytics integration. Account lookup. The search being saved on the backend.
- cek 12y agoI needed a break so I used this as an excuse to try to remember how Windows actually handled keyboard input. I submitted a pull request: https://github.com/alex/what-happens-when/pull/21 https://github.com/alex/what-happens-when/pull/21
- TheLoneWolfling 12y agoIt frustrates me that it just goes "Interrupt fires". There's a whole lot that goes on between the USB bus receiving the packet and HID driver - I mean, even making the processor branch is non-trivial.
- 300bps 12y agoOn the network level, seems to have missed the ARP protocol entirely. Didn't seem to mention the function of the multiple routers between client and server, the calculations of netblock and subnet mask, role of firewalls between client and host, etc, etc. Probably missing off the top of my head at least 100 steps. If you sat down to write a paper on it he's probably missing closer to 1,000 discrete units of work in the overall process.
- aptwebapps 12y agoIt's a WIP. Scroll down and you'll see a lot more similar headings. The ellipsis is to indicate that the section is incomplete. Perhaps you can contribute?
- TheLoneWolfling 12y agoI don't know the details of that section myself - I'd love to find out, hence my disappointment that it wasn't there.
- jdbernard 12y agoI agree. Fork it, flesh out those details and submit a pull request. I get the feeling this is very much a work in progresses.
- TheLoneWolfling 12y agoI don't know the details of that section myself - I'd love to find out, hence my disappointment that it wasn't there.
- rasz_pl 12y ago>USB bus receiving the packet its not really receiving packets, its receiving data _you specifically requested in YOUR packet_. in USB only host is capable of generating traffic on the bus, your device cant generate any packets, only answer to them.
- stephen_g 12y agoLots of interesting things happen in between your computer and Google's servers - like ISPs exchanging routing information using BGP, so the routers can determine a route through each different AS (provider/transit network) it has to go through to actually Fong the machine with that IP, and the kinds of physical and data layers it goes through (cable or DSL, fibre, and Ethernet, SONET/SDH, maybe tunnelling over MPLS at some point) etc.
- deleted 12y ago[deleted]
- lnanek2 12y agoIt's pretty common to fail someone out at that point. If you wanted to be charitable you could try to ask them questions as much like homework questions from university as possible. "Write out in [psuedo] code how you would add two numbers and display the result on the screen using system interrupts" or something. You may have to pay the ultimate price and be stuck working with the person after that, though.
- dogweather 12y agoI prefer to ask open-ended questions more calculated to give me an idea of where the interviewee's head is at: "What's your favorite programming language? Why?"
- ekr 12y agoThis would make a great subject for a book, along the lines of NAND2Tetris, starting at the transistor level or below.
- arkaine 12y agoLack of arp/layer 2 isp, routing. There is also a mistake inside the DNS part. DNS queries are done from the client - and this is actually true for a majority of client/server requests - by opening a dynamic random port above 49152.
- stevenspins 12y agoThere is also a mistake inside the DNS part. DNS queries are done from the client - and this is actually true for a majority of client/server requests - by opening a dynamic random port above 49152.
- deleted 12y ago[deleted]
- toadi 12y agoCan't remember how many jobs I did where the interview questions were the hardest part of the job. In the beginning you think wow I'm going to get a nice and existing job. Just to be dissapointed again because the job consists of fixing bugs in crappy legacy code and writing CRUD code.
- jodrellblank 12y agoPeople look at you strangely and explain how browser URL bars search for you in all recent browsers, making the Google homepage irrelevant. Maybe they explain how home pages and bookmarks and bookmarklets work and set one up for you. Nobody explains anything technical; the sort of person who types Google.com into a URL bar in 2015 isn't very computer literate, and wouldn't care about the details - any details.
- MarcScott 12y agoI'm going to watch this carefully. Once it's complete I plan to base a scheme of work on it for my secondary school CS students.
- jtheory 12y ago"Once it's complete" indeed... and to draw that particular random line in the sand?
- jwatte 12y agoI have asked this question (more or less,) and the point is to get the candidate to singer point where they don't know the answer, and then the real question comes: "so how would you design that next piece?" That's the interesting part!