Saturday, 15 February 2014

Interview experience with Google

This may sound unbelievable but it all started a few months back in late 2013, when I saw a really cool movie called "The internship". Of course I had been thinking about applying for a software eng. intern position at Google for a long time, but it was this movie which made me get up from my couch of epic laziness and start preparing for the experience that was to follow! Unlike the movie, my story doesn't end with me getting a position at all, but it certainly is about the interesting path for a learning experience. So after watching the movie, I started preparing my application and submitted it within a few days. Pretty standard details were required for submission at this point. 

The next morning I got an email from Google. By the time I received this email, I was already really excited that my application had gone "through" the system. The email contained a link to a form, which asked for a lot of details this time. From things like programming languages to location preferences, it had pretty much everything in it. I took some time doing research on the different Google locations mentioned in the form and matched my background and experience to choose the ones that I could fit in easily. While I was looking at webpages of different Google center's locations across Europe, I noticed that each page had a unique but interesting way of writing the Number of Googlers that worked there. They had "hidden" the numbers with a very interesting and clever way. Things like number of beer breweries in Germany or three times the third perfect number were found on these pages. Interestingly these numbers can be easily found if you just "Google" them!! (haha). My personal favorite statement was the one for Google's center in Zurich and frankly speaking it was the only one for which I didn't had to "Google". It said: "Not as many as the number of megawatts it takes to go back in time". Loved this!

Anyways, continuing with the application process. I filled in all my details and submitted the form. This time I had to wait a few months before a recruitment contact got back to me. They asked me for my availability in order to arrange two phone interviews with 45 mins for each interview slot. They also had a list of links with useful details on how to prepare for this interview, which was something I have never seen before for any interview. These links actually contained tips on interview directly from the people responsible for carrying out this task at Google. I thought about how cool this was, usually companies do not give out such details, but here I was with everything I needed to prepare. I was almost jumping with excitement at this point. I replied with my best availability and started preparing for the big challenge.

I worked on my C++, read books, wrote algorithms, read more books, researched on the interview questions and got all my C++ concepts refreshed for the interview day. 

On the interview day, I got up, had my breakfast and again did some last minute revision! THIS WAS IT! Everything I had learned, used, read about, researched or ever heard about was going to be tested. For the interviews I had been given links to Google docs where me and my interviewers can share my code.

My first interviewer was a lady, she introduced her self and got straight down to the questions. Among the two interviews, this was the difficult one. She asked me two algorithm design questions, thats all! First question was related to normalizing a file path in Linux. Although I had used linux before, I had no clue about how this can work. So I wrote a code which took a String and parsed it one by one, checking for path names. This went pretty bad, but still I managed to write something which worked fine for the scenario I had understood. Next question she asked might have been the hardest of all the interview questions. I was to design an algorithm which took a number of process ids and their dependency list on other processes and arranged them in order of execution in such a way that each process' dependency  must have been completed before its execution. This time I understood the question fine and wrote a code which worked in some scenarios. Towards the end of the interview I finally figured out that this can be easily done with a recursive function, however at this point I had no time left. I told the interviewer what I could have done if I had more time. She agreed to it and asked me if I had any questions for her before finishing the interview. At this point I was completely blank so I asked her a typical question about the rest of the recruitment process. She explained it and hung up. I had 15 mins to spare before the next interview, enough to have a cup of tea and relax a bit (hahaha).

The second interviewer was a guy who also introduced himself and went straight to the questions. The questions he asked were pretty easy. It seemed to me that he was more interested in how I was solving the problem than the actual coding details itself. He asked me to design an algorithm which returns the character with highest occurrence within a string. This seemed pretty straight forward and I wrote a code for checking the string and returning the character. Next he asked me to optimize the code as my code contained a lot of nested for loops, making it really complex. With a lot of hints from the interviewer, I was able to come to a perfect solution which used hashmaps. Next question he asked was a tricky one, and I still haven't figured out the best solution for it yet. He asked that given two nodes in a tree where each node points towards a root node up one level in the hierarchy, how can I find their closest common root node? This was tricky and I had some solutions to it, but they were not the best ones. This time again I used all my time and the interviewer had to interrupt me to finish the call.

I totally enjoyed these interviews, which really made me think about how I can improve my coding. I liked the part where each interviewer was more interested in my ideas than the actual code. This might be the reason for all the innovation that is happening at Google right now. Most interviews I have been to focused more on how well I know a particular language than on how I solved a problem. I personally think you can learn a lot of programming languages, but first you need to learn how to solve a given problem properly.

I got an email the following week, informing me that Google's recruitment team has decided not to move forward with my application. This was not a shock to me, given how my interviews went. However the whole process was really an enjoyable experience, which has now motivated me more than ever to apply for a Google internship again in future.