Applied for Google Software Engineer position online. Recruiter contacted me within a week to set-up a phone interview. The phone screen was scheduled within week. The interviewer asked about various data structures and general computer science concepts. Asked me several questions about queues, and heaps. After that two programming questions: 1) traverse array in a spiral order. 2) check if directed graph contains a cycle. in 2 weeks I was contacted to set up on-site interview. I asked to schedule interview 3 weeks later, so I could prepare for it.
There were 4 technical interviews onsite, one lunch interview (just informal talk with some guy from Google glass department), and lastly PhD dissertation discussion.
First question was in-order traversal of BST. I wrote the code. Then asked me two check if two different BSTs have same inorder traversal. I suggested to store first inorder traversal into vector, and while traversing second BST check if the element values match. I also started suggesting using linked list, or modified recursive approach, but he said to make life easy and go with the simple solution.
Second interviewer gave me array, with elements first strictly increasing, then strictly decreasing. Asked me to find the largest number. I suggested to use binary search. O(logN) time complexity, with no additional space required. After implementing the code he asked another question. Given infinite doubly linked list, and separate list of elements, which are linked to some linked list elements. Find out from the list of elements how many neighboring groups are formed. I suggested to use Hashtable, to make look-up process quick, and traverse the elements and check if they are neighboring elements. O(N) time and space complexity. Implemented the code, and time ran out to test if with different cases.
Third interview was the weirdest. The guy had thick accent and from the beginning became apparent communication was an issue. He gave me system design question: Observer class has three methods AddObserver(), RemoveObserver(), NotifyAllObservers(). After asking some clarification questions, I suggested to use doubly linked list to keep track of all observers, and hash table to look-up the individual observer. Then he asked to implement three methods. After implementing the code in JAVA he told me the program would not work. Apparently the Observer was designed for Chrome browser. He went into details when user clicks on mouse and then key-press is released. I responded the initial question was very vague and asked for more clarification and precise requirements. I suggested what I would change to go around the problem, but time ran out and didn't get a chance to modify the code on whiteboard.
After that I had lunch and came back for fourth technical interview.
Fourth interview: the guy told me to add two numbers in base 3 system. The input: two base 3 streams provided as String. function should return sum of the two numbers also in String format as base 3 stream. I suggested to convert from base 3 into base 10, add numbers and convert back to base 3. I know how to add two (base 2) binary streams without conversion, since I was under the time pressure I went easy way. I implemented conversion from base 3 to base 10. The interviewer said he was satisfied and wanted me to solve another problem. He gave me file size, and asked me to partition file into chunks, so that each chunk size is power of two, and the number of chunks is minimal. I suggested to find the nearest power of two and obtain absolute value of difference between the original file size, and nearest power of two. Then re-apply the process until reminder is power of two (1 is 2^0). There was time pressure, so didn't have time for analysis, just implemented and turned in the code.
Last interview was PhD dissertation discussion. It went alright. Most interviews went ok, except the 3rd one, during which I had hard time communicating. Within a week recruiter emailed me saying hiring committee didn't want to move forward with hiring.