I would like to thank the LeetCode community and the platform. LeetCode has helped me immensly throughout my interview preparation. The community here is absolutely brilliant and the ease of the interface and the questions on the platform are a cherry on top. I would like to share my experience of interviewing at Google. The post is a bit long so grab a snack folks! :D
Some background about me. Bachelors in Computer Science from a Tier 1 college in India. 2 years at a MNC.
1. Application
I had taken a referral from a friend in March 2020. I applied for 2 roles. Within 2 days I got a mail from the HR stating that my experience was less and I should apply a role that matches my experience or apply when a suitable role opens up. I kept checking LinkedIn for job posting but everything required ~5 years of experience.
Fast forward to mid July, a recruiter from Google approached me saying that they found my resume in the system and a hiring manager found it quite impressive and they would like me to interview and join that team.
I was elated and surprised that I have got a chance to interview at my dream company in this unusual manner.
2. Timeline
I already had an offer and the tentative joining date was decided to be around the last week of August. I discussed with the recruiter regarding speeding up the process to conclude it latest by the third week of August.
- Mid July: Approached by recruiter
- Last week of July: Phone screen(virtual)
- End of July: Feedback and green light for onsite(virtual)
- First week of August: 5 interviews conducted across 3 days
- Second week of August: Hiring committee approval and team matching
- Mid August: Offer
The whole process was concluded in less than a month. My recruiter was wonderful. Everything was conducted with amazing swiftness keeping in mind the fact that I had a competing offer. Generally the process spans across a couple of months.
3. Interviews
Due to NDA I would not be able to give out specific details. But I will give a general idea of the type of questions asked and which data structure/algorithm it revolved around.
- Phone screen
The interviewer was very friendly and got right to the problem after his brief introduction.
- Q1: Counting the number of distinct events that accured in a fixed time window. [HashMap]
- Q2: A difficult problem you solved and how? Discussed a recent issue I tackled at work.
- Q3: Given the excel column number return the label. [26 base number system]
- Feedback: Recruiter informed that I aced the round. The speed of coding and the formulation of the solutions was on point.
Now onto the big ones. Onsite!
- Onsite 1
I was a bit nervous for this one. First interview at Google, had some butterflies. :)
- Q1: Array problem involving prefix and suffix sums.
- Q2: Variation of the 1st problem. Enter Dynamic Programming!
- Feedback: I did well here. I was able to solve both the problems. Space complexity was sub-optimal but I improved it when the interviewer asked. Missed a boundary condition, but fixed it on my own while dry running with an example.
- Onsite 2
This was the behavioral aka "Googlyness" interview. The interviewer was an absolute delight. During the post interview QnA it was two guys just fanboying over Google. XD
- Discussion about general work scenarios covering leadership, conflict with a colleague and delivering under pressure.
- Technical discussion of testing a new feature in a Google Photos.
- Hypothetical scenario asking what you'll do when some team members don't want to participate in a team bonding activity. Always a fun one! :P
- Feedback: This round went great. The discussions were fun and I sent the "right signals" that Google looks for.
- Onsite 3
The interviewer wasn't very friendly and wasn't on time either. The vibe during the whole interview wasn't very positive.
- Q1: Last node in a level order increasing numbered complete binary tree. Involved the mathematical relationship of parent and children in a complete binary tree. (Parent->n Children-> 2n+1 and 2n+2)
- Q2: Follow-up of the first involving binary search while calculating the function written for the first part on the "mid".
- Feedback: Took a long time to figure out the first one after the interviewer's hints. Discussed the correct approach for the second one but couldn't code it completely due to the time constraint. This was the weakest interview. The recruiter informed that it wasn't bad but relatively weak compared to other ones.
- Onsite 4
A very friendly interviewer again. This helped me shed a bit of the nerves due to a not so great performance in the previous round.
- Q1: The kth largest element in a running stream of numbers. The k is fixed. These kind of problems are generally heaps.
- Q2: A follow-up with range of numbers in the stream is smaller but the k is now variable. Binary search on a prefix sum over the frequency of the range.
- Feedback: I did pretty good here. Discussed my approach properly and wrote code at a good speed. I also discussed some overhead reductions for the push and pop in the heap. I missed a boundary condition but fixed it when the interviewer pointed it out.
- Onsite 5
The interviewer sounded a bit nervous himself. Probably wasn't very experienced. After a couple of minutes, I guess we both eased into the interview. XD
- Q1: Farthest leaf from root in a n-ary tree with weighted edges. Simple recursion. The tricky bit was that the interviewer asked to define the struct for the tree. I suggested a design but refined it when the interviewer said to extrapolate it considering the follow-up is a graph instead of the tree.
- Q2: The same problem but now the tree is a graph. After pondering a bit I realised that this was essentially a Dijkstra problem and the answer was the node with the maximum value in the "dist" array of Dijkstra.
- Feedback: The recruiter said this was a near perfect interview. I was very clear in my thought process and quickly wrote bug free code. I got bonus points for dry running complex test cases during the interview. :D
4. Preparation and my 2 cents
- Quality over quantity any day. This is a pretty common advice and it actually makes a lot of sense. Rather than slogging focus on cocncept building, tricky implementations and getting the fundamentals right with practice.
- ~260 LC (40 easy, 160 medium, 60 hard). I feel the 25/50/25 split is ideal. Go back to easy when you feel low on confidence (maybe after a couple of unsuccesful goes at the hard ones XD). The first problem in Google interviews is generally easy medium and the follow-up/second problem is medium hard.
- Be efficient in preparation. Don't pickup some tedious graph or geometry algorithms and master them. They are very rarely asked. Focus of the topics that are commonly asked, like DP, trees(DFS/BFS), strings, graphs(MST, shortest path), stacks/queues/heaps, binary search, sliding window, 2 pointers, basic maths(combinatorics, tricks), tries and recursion.
- Make sure you go through the discussion forum even if you solved the problem very easily. There are some wise folks out there who write some magical code. :P
- Thinking out loud. This is key during interviews. Practice this while solving problems. Try to build the solution incrementally. The more systematic your thinking, the easier it is to communicate with the interviewer. The point is to not have awkward silences during the interview. It is okay to discuss a sub-optimal/brute-force approach if that is the only thing coming to your mind. The interviewer might give some hints and nudge you in the right direction.
- I had prepared a list of behavioral questions after some research online. It is always good to have atleast 2 stories for each scenario as you might have overlapping stories for some scenarios. I went through my compiled answers and made sure I had the points in mind. Learning the answers by rote doesn't have a conviction to it. So better to keep in mind the story points and go with the flow of the conversation while giving your answer.
5. Offer
My recruiter organized calls with a couple of hiring managers. Although they say these calls are informal, be prepared for some grilling. Some of the HMs might be very chill, others not so much. The HM has to judge if you are a good fit for their team so they might have some domain related or behavioral questions for you. You should also clarify any doubts you have regarding the team, work, technologies used and future scope of the team. After all you wouldn't want to join Google and end up in the wrong team. I found a team I was excited about and the final offer was rolled out in a couple of days.
Edit: Adding a few tips and questions for the behavioral round preparation.
A good introduction is an ice-breaker and gives you a lot of confidence. Be crisp and precise and don't give out details as they already have your resume. Have a good introduction prepared and it is better if it aligns with the role you are interviewing for.
Here is a list of behavioral questions which should cover a lot of variations of the questions that are asked in interviews. You can mould your stories accordingly during the interviews. Also, the strengths/weakness are very easy to mess up. Don't give out cliche stuff. Figure out some genuine strength and weaknesses and be realistic. Own up to your weaknesses/failures and be humble about your strengths/successes.
- Explain a time when you took the initiative on a project.
- Describe how you used your problem-solving skills to benefit a team or company.
- What’s the best idea you’ve come up with on a team-based project?
- How do you approach problems? What’s your process?
- Are you better at working with a team or working on your own?
- Strengths/weakness you have.
- Tell me about a time you failed.
- Are you someone who learns from failures?
- Give me an example of when you set a goal and how you achieved it.
- How do you juggle multiple projects?
- Tell me about a time when you worked well under pressure.
- Tell me about a time when you failed in a team project, and how you overcame it.
- Tell me about a time when you stood up against something.
- Tell me about a time you were ocnsulted with a problem.
- Have you had a disagreement with your manager?
- How do you measure success?
Best of luck! To infinity and beyond!