It is the first technical interview with a software engineer from Google, second phone call after an informal call with the recruiter which had two simple questions about complexity. One interesting point I was told by the recruiter, that he considered Ain Shams University a good one. And honestly, I was impressed and wondering as we didn’t have many graduates at Google now. Maybe only one? Well, recruiters must have their ways!
Getting ready
Long term
I knew about ten days prior to the interview so I had enough time to prepare. I started asking recent interviewees about what to expect and any advice about the topics to try to cover and revise. Searching on the web for any other interviewees and read their experience – and this is what had encouraged me to write that post as I found it very helpful. I made a list of all the topics which has been mentioned or advised to revise. It was mostly about data structures and algorithms plus a bit about operating systems and other general computer science concepts.
Had ten days, so yes I was able to finish all what I expected to finish, except one topic: dynamic programming which I thought from opinions that it’s a bit advanced for the first interview. In addition to solving some TopCoder problems, which was not more than two daily and I consider that was low and it should have been increased.
Short term
On the night before the call, I came home back early, prepared some blank paper sheets, pens and some notes which I thought they might be useful. Checked the Google doc -which will be used for coding- to make sure it was connected. Prepared the headphones for the phone and a charger plugged in. Before sleeping, I solved one DIV 2 500 on TopCoder and went to bed early. However, it took me a while to fall asleep but it was okay, as it was a weekend – Friday is off.
It is two hours before the phone call. Had a look on binary trees and then watched an episode of Friends, thought it would take me out of stress. Then solved a DIV 2 250 to warm up and not exhaust my mind. About 30 minutes before the interview, went to get some tea, walking around the apartment and listening to music. Three minutes before the call I went into the room and closed the door. The phone rang!
Interviewing
I have read more than once from other candidates’ experience that it is not allowed to talk about onsite interviews, but I wasn’t told anything concerning the phone ones, however I think it might not be very easy for the interviewer to have to develop two new problems for every new interviewee.
He welcomed me and introduced himself and told me there will be two questions. It was short and he got directly to the first question. It was a problem and it took me some time trying to understand and analyze the question especially the input and output. I was quickly able to find the brute force solution of O(n2). Being used to TopCoder and small input, no need for other data structure when the input won’t exceed 50 so I thought of this solution at first and it took me some time till I was able to try to think smarter – mistake 1. He asked me to code the solution I have just said using any programming language – don’t he considered C# one. He said he prefers C++ or Java as they use those languages in most of the projects in Google. I was told that I have two bugs. One of them was forgetting first initialization of a variable and the second one was writing = instead of == in an if statement.
He asked me if there was a better solution, I started to think again and try to get out of the box which I stuck myself in – mistake 2. I thought of a solution which involves sorting and then binary search leading to complexity O(nlog2n).
He said that it could be solved in linear time. I thought that it might be represented by a linked list. Then he told me what about using a hashmap. I got it by then, but it was obviously too late. Then he asked about what the key would represent, I answered that. He asked me how to write that using C++, I wrote the mapping but not in the exact syntax – mistake 3.
The end
After that question, the call had been going for 45 minutes so he told me we have run out of time thus there is not time for the second question which was planned. I was like “No, wait! Please, don’t leave with that impression; I want to have the second question : (”
Lessons learned
The question was not that hard, but I was not able to answer it correctly due to two main reasons and a smaller one which I could figure out so far
- I was over worried even inside the interview, sometime I feel my mind is blocked and like someone suddenly rises and talks in my mind “MAN, YOU ARE TALKING TO FUCKING GOOGLE! CONCENTRATE!” and other negative thoughts thus of course I did not concentrate but the opposite happens. This resulted in having some bugs through the code at first and not thinking about the idea of hashing. Although I had read that and even there was a quote by “Arnie Widdowson” on some website saying “when in doubt use hashtables” but I forgot that as if my mind was empty! Also, I think my explanation was not very clear.
- I should have thought outside the box. I felt my thinking was kinda limited into the TopCoder problems. Of course, it is my mistake that I focused only on one type and didn’t open my mind well.
- Another one which I consider it a bit less than the two above, which is know more about the syntax of the data structure not only the concept. Like in my case, I could even build the class but I did not know how to initialize and use a hashmap in C++!
Right after the interview, I hated myslf and felt stupid! But about a couple of hours later I started to think and figure out the problems. That was my first experience with Google, short unfortunately. If you have been interviewed with Google before, it will be helpful to post your experience as well. Thank you : )


