Follow me on Twitter for my latest adventures!
Two weeks ago I had an on-site interview at Google in Mountain View, California! The job interview with Google was an interesting experience and I want to tell you about it.
The position I was interviewing for was a Google SRE. SRE stands for Site Reliability Engineering. Site reliability engineers (SREs) are both software engineers and systems administrators, responsible for Google's production services from end-to-end.
There were eight separate interviews. The first three were over the phone (phone interviews) and the remaining five were on-site. The first interview was with the recruiter and was not very technical but the other seven were very technical.
All interviews went pretty well but I just learned that I won't be getting hired. I personally think that I did really well. I answered all the questions but it seems they were not satisfied. Google and the recruiter didn't give me precise reasons. He said that "the morning interviews were not that great" and "I should get more experience to work in their mission critical team."
Here is how it all happened.
Shortly after I published the "Code Reuse in Google Chrome" post I was contacted by a recruiter at Google. The email said:
I recruit top notch Software Engineering talent at Google. I recently came across your name as a possible world class Engineer and am intrigued to know more about you. I promise to exchange some detailed info about us as well.
Interested to hear more? Want to be an impact player at Google? Then please respond with a current (English) copy of your resume and I'll be happy to call you and discuss.
At first I thought I would be applying for a software developer position, but after we went through my skillset, the recruiter concluded that I would better fit as an SRE. I agreed with him. This seemed like a perfect position for me. I love systems administration as much as I love programming.
First Interview (phone)
The first interview was on the 10th of September with the recruiter. He explained the Google recruitment process to me and we went through my skill set. I had to rank myself from 0 - 10 in a bunch of areas such as C programming, C++ programming, Python programming, networking, algorithms and data structures, distributed systems, Linux systems administration, and others.
As I said, based on my answers we concluded that SRE was the best position for me. An SRE basically has to know everything: algorithms, data structures, programming, networking, distributed systems, scalable architecture, troubleshooting. It's a great hacker position!
After these questions he asked me where I would like to work - Google office in Ireland, Zurich, Mountain View or Australia. I said Mountain View as it's the Googleplex!
The second half of the interview had some basic technical questions, just to make sure I knew something. The questions were about Linux systems administration, algorithms, computer architecture and C programming. I can't go into any details because I signed a non-disclosure agreement. (Update: NDA expired, so I posted all the interview questions at the bottom of this post.)
I made some factual mistakes but he was satisfied and we scheduled the next phone interview. He warned me that it will be very technical and I should do really good preps. I asked him to give me a plenty of time for the preparation and we scheduled the next interview on 22nd of September.
He also told me that each phone interview is going to be 45 minutes to 1 hour long.
I started preparing like crazy. I found three presentations on what SRE is all about:
- Engineering Reliability into Web Sites: Google SRE
- Google SRE: That Couldn't Happen to US... Could It?
- Google SRE: Chasing Uptime
Then I found all the other blog posts about interviews and interview questions at Google:
- Corey Trager's Google Interview
- Rod Hilton's Google Interview
- Ben Watson's Google Interview
- Shaun Boyd's Google Interview
- How I Blew My Google Interview by Henry Blodget
- Get That Job at Google by Steve Yegge
- Tales from the Google's interview room
- Google Interview Questions
- Google Interview Questions -- Fun Brain Teasers!
- And some others...
I printed and read four Google research papers:
- The Google File System
- Bigtable: A Distributed Storage System for Structured Data
- MapReduce: Simplified Data Processing on Large Clusters
- and just for fun Failure Trends in a Large Disk Drive Population
I also went through several books:
- the best book on basics of networking "TCP/IP Illustrated"
- the best book on algorithms "MIT's Introduction to Algorithms" + my notes on algorithms
- a book on scalability "Building Scalable Web Sites"
Second Interview (phone)
The second phone interview was with an engineer from Google. He worked on the Ads team which is responsible for running AdSense, AdWords and other advertisement stuff.
The interview was very technical and started with an algorithmic problem which was too large to fit in computer memory. I had to tell him precisely how I would get around this problem and what data structures and algorithms I would use. He also asked me to think out loudly. The interview continued with questions about data structures, DNS, TCP protocol, a security vulnerability associated with TCP, networking in general, and Google itself.
The questions basically where:
- You've 100GB file but only 1GB of memory. How would you sort it?
- Tell me about your favorite data structure.
- How does DNS work?
- Can DNS work over TCP?
- How do DNS root servers work?
- How does BGP work?
- How does TCP work and what is 3-way handshake?
- How does TCP session spoofing works and how is it prevented?
- What would you change at Google?
After the interview the engineer had to write feedback on me. It was positive and I could move on with the interviews.
Third Interview (phone)
I gave myself more time to prepare and the third interview was on the 1st of October. It was with an engineer from the Google traffic team.
In this interview I had a very simple programming question and I had to do coding over phone. I was free to choose the language and I chose Perl as it is my most favorite programming language. It was impossible to dictate Perl syntax over phone "for my dollar sign element open paren at data close paren open curly brace ... close curly brace" so I submitted my Perl program over the email.
The question was: Write a program to find set difference. Given two sets A and B, find elements in A-B, or in other words, find elements in set A that are not in B.
Then the same problem was taken to the next level, what if the data we are working on is gigabytes in size, terabytes in size. How would my program/solution change?
Finally I had a question about DNS again, then HTTP protocol, routing, and TCP data transfer.
The questions were:
- How does DNS work?
- How does HTTP work?
- If a HTTP request fails, does operating system retry it, or the browser?
The feedback was positive and I could prepare for the on-site interviews. In my conversation with my recruiter I got to know that there will be five on-site interviews, each exactly 45 minutes long. One on my previous work experience, one on algorithms and data structures, one on troubleshooting and networking, and two on software development with focus on C and C++.
My recruiter suggested that I read a few more documents:
- Google C++ Style Guide
- Web Search for a Planet: The Google Cluster Architecture
- Algorithm Tutorials on TopCoder
I flew out to interview on 24th of October and arrived in California at 8pm. Google paid for my trip, hotel, cab and food.
Fourth Interview (on-site)
The fourth interview was finally at Googleplex! At 10am I met my recruiter and we had a 15 minute discussion about the interviews. He told me I would have two interviews now, then one of Google engineers would take me to lunch to one of Google's restaurants and then I would have three other interviews.
At 10:15am the first on-site interview began. It was about my previous job experience. I have had a lot of job experience in the past and I decided to tell about a physical security notification system that I coded in C on Linux a few years ago. The system would receive messages through the serial port and send out emails and text messages.
In the last minutes of the interview he asked me some basic Unix filesystem questions. What is an inode?
In all the on-site interviews I was writing and drawing on two big whiteboards.
Fifth Interview (on-site)
The fifth interview began at 11am. It was a coding session and began with a trick question and not a real coding problem. The trick question was: What's the angle between clock hands when it's 3:15. Then I was asked to implement the solution in C for arbitrary hour:minute. The solution was a mathematical expression that was a one-line return statement. No big coding there. Then I was asked to write an implementation of a binary tree. While coding I made a mistake and forgot to initialize part of a data structure that I had malloc()'ed. The program would have segfault'ed in real life and I would have noticed the error. I said there were no errors here but the Google engineer pointed out I hadn't initialized data.
After this interview I was taken to lunch by the engineer who interviewed me on the second (phone) interview. She told me she was working at Google for two years and was very happy about it. We went to Asian food restaurant (located in Googleplex). Then she showed me around Googleplex.
Sixth Interview (on-site)
The sixth interview began at 12:45pm. It was a troubleshooting and networking interview. The interviewer drew a network diagram on the whiteboard and had imagined a problem in there. I had to ask a bunch of specific networking questions to locate the problem. He was satisfied and in the last few minutes of the interview he asked me some specific networking device questions, like what's the difference between a router and a switch and what's OSI model.
Seventh Interview (on-site)
The seventh interview began at 1:30pm. It was a coding session. I was asked to implement a simple string manipulation subroutine that finds common characters in two C strings. I could use either C or C++. I chose C. Unfortunately I made an off-by-one mistake there - the most common programming mistake in the history of mankind. The whole interview focused on this one problem.
Eighth Interview (on-site)
The last, eight, interview began at 2:15pm. It was algorithms and data structures interview. The problem presented here was similar to the problem in the 2nd interview. Not only was it a problem too large to fit in computer memory but it also was distributed. How to sort data that doesn't fit in memory and you've 100 computers to sort it. I had to do all kinds of trickery to solve it. The interview was very free-style and we talked back and forth about the problem. I arrived at the correct solution near the end of the interview and he said that not many candidates get that far in the solution. I was also asked if I knew mapreduce and of course I knew mapreduce as I had read the Google paper. This was basically a mapreduce problem.
After the interview the engineer escorted me out to the lobby and I took a cab back to my hotel.
Overall the Google interviews were super fun. I love trivia questions like they ask in interviews. The interview questions were technical but not very challenging or difficult.
Update: Now that my NDA has expired, here are some the interview questions that I remember.
- Tell me about one of the projects on your resume.
- What technologies did you use to get this project going?
- What if your project had 5000 or 50000 or 5000000 users?
- What's an inode?
- What's the angle between clock faces when it's 3:15?
- Write a C function that returns angle between clock faces for any (hour, minute).
- Write a binary tree.
- How would you troubleshoot this problem - network diagram prestented.
- What's the difference between a router and switch?
- Implement a routine in C that counts number of characters in a string.
- Given 100GB file and a computer with 1GB of memory, how would you sort it.
- Can you make it parallel and solve it on 100 computers?
- What's a priority queue?
- How does BGP work?
- Can DNS use TCP? In which cases DNS uses TCP?
- Implement set difference in any language you like.
- How does HTTP work?
- How does 3 way handshake work in TCP?
- What's the system call for creating files?