Google Interview Part-2

Jay Shah
5 min readJul 15, 2018

I will be sharing how I cracked my 1st Google Phone Interview and skipped my 2nd Phone interview. If you have not read Google Interview Part-1 then go check it out

LeetCode Google-50 Easy

I had 15 days in hands before the phone interview. I started by solving LeetCode Easy questions. I solved almost all the Google top 50 Easy level questions in 7 days. I did not take rest. As soon as I would finish one problem I would go for the next problem. Slowly my mind started thinking dynamically. For every problem, I started constantly thinking about how can I optimize my current solution. I also started thinking about how to handle basic edge cases like what if the inputs are empty or what if the array of integers have negative elements.

Dynamic Programming

After solving the easy questions on LeetCode I had 7 days in hands. I focused on Dynamic Programming with Tabulation. For the next two days, I studied and practiced DP problems. I discovered the following contents:

  • Tushar Roy video series: This is an amazing video series if you want to learn how to come up with tabulation techniques for the problems. I watched almost all the videos in the video series.
  • GeeksForGeeks video series on Dynamic Programming: GeeksForGeeks is an amazing place to read articles on any topic related to Algorithms and Data Structures and many articles have videos

After watching these videos I went to LeetCode to solve Dynamic Programming related questions. Now for many of the problems I could just look at the problem and say whether it has a Dynamic Programming Solution or not.

LeetCode Google-50 Medium

Now I had 5 days in hands. I decided to go for medium level questions in Google top 50. Suddenly I realized that many of medium level questions, I solved it very quickly and for many of the problems, I could just say which data structure to use. For example :

  • If there is anything related to counting the frequency of the words or characters then the best data structure would be to use a hash map
  • If there is anything related to finding some kind of sub-string then the first data structure that comes to my mind is to have two pointers and try a sliding window approach
  • If there is anything related to a sorted array then the first thing that comes to my mind is a binary search
  • If there is anything related to closing brackets and opening bracket or any problem having pair verification then we can use stacks

I felt really amazing by solving Medium level questions. I did not solve all the medium level question in Google top 50.

Revision

Now I had 2 days in my hands. I decided to revisit all the problems that I solved on LeetCode. I use to go to the problems and think of a solution and then verify with the actual solution. For any problem, if I was not confident then I would code the solution. By doing this for many of the problems the solutions were fit into my mind. Even if someone asked me those problems during my sleep I could have given them the solution. I did a lot of practice.

The Phone Interview Day

I woke up in the morning. I had my office from 10:00 am to 3:00 pm. I had my phone interview at 5:00 pm. I had to set up a lab room at my office that day. I had to make tables and lift heavy tables from one place to another. My manager told me that I have to work till 5:00 pm. I could not tell him no because I knew there was a lot of work left and we had to set up the Lab today. I requested him that I will work till 4:45 pm. I left at 4:40 pm and went to my office room to give the interview. By that time I was already exhausted and there were times when I thought of rescheduling the interview. But I decided not to because this was my only chance and I worked really hard for today’s day. The interviewer called me 10 minutes late. He asked me how are you and I replied “I am exhausted” and then I asked him back “How Are You?” and he replied “Even I am exhausted” and I don’t know why I felt that funny because I was thinking that you did not lift those heavy tables and made new tables. He mailed me the link to Google Docs and gave me a problem to solve. I can not disclose any of the problems because I signed a NDA form with Google. The problem was a variation of a subsequence problem. I immediately gave him a solution verbally and I asked him whether I can code the solution. He said yes. While I was coding I became very nervous and wanted to go to the restroom but I know I could not go to the restroom while I am coding because he might think that I went to take help from somewhere. So I coded the solution in 5 minutes and he told okay I have a follow up for the problem. Before he could give me the follow up I told him “I need to go to the restroom before we start” and he said “sure, you can go”. I ran to the restroom and came back and told him “sorry for that”. He asked me three follow-ups to the original question and I answered them all with the code. In the end, he asked me to give the time complexity of the last solution. At the end of 5 minutes, he asked if I have any questions and I just asked him that in which team you work at Google and what technologies do you use.

Phone Interview Results

After the interview, I was confident that they should select me for the 2nd Phone Interview. I felt satisfied because I solved 4 questions in 45 minutes. Within 2 days I get a call from the recruiter and over the call he told me “Congratulations, you are selected for the onsite interview. You have to choose a location for the onsite interview.” I was shocked and confused because first I thought that there was some kind of a mix-up because I did not give my 2nd phone interview so I asked him “Are you sure that there is no more phone interview for me.” He said, “We have decided to bring you onsite and there are no more phone interviews.” I could not believe this and I was happy and excited. I felt that I am still dreaming. After the call ended the recruiter mailed me by giving a confirmation that I have been selected for the onsite interview and I have to fill up the form and give my available dates. After reading that mail I told myself that this is not a dream and I have actually skipped the 2nd phone interview. I was really proud of myself and that day I watched that mail 20 times before going to sleep.

Check out my next post here, I have shared my Google onsite Interview process experience.

Thanks for reading. If you enjoyed this article, feel free to hit that clap button 👏 to help others find it. (Do you know that you can clap more than once? Try it and see for yourself!)

--

--