I recently interviewed with Google for L3 role and got the offer. As I found Leetcode's community very helpful while I was preparing, I thought of giving back to it by writing this.
I have around 1.5 years of experience in the industry.
I applied for 3 roles with referral around mid of September 2024. Out of which 2 applications got rejected and I got a call back for one of the applications around mid of November 2024. My LC count was around 450 when 2 of my applications got rejected. I was solving problems on LC to get my touch back on DSA and got the count around 550 in November 2024. I do believe adding a good LC or any coding profile link in your resume will get you a call as Google's interviews for L3 and L4 are purely based on DSA.
The recruiter reached out to me via mail and asked for my updated CV. Followed by a short call on Gmeet, explaining the Google's interview process. I was asked some basic questions on DSA and how do I rate myself on DSA out of 10. I was asked my coding language preference. I used Java in all my coding rounds. Just bragged for some 15 minutes and moved forward to scheduling initial phone screen. My recruiter gave me 3 weeks to brush up on DSA and scheduled the phone screen on early December 2024.
The interviewer was from Hyderabad, India office. He greeted me and introduced himself. He said he's also a Noogler (New to Google) and asked me to introduce myself. I kept my introduction very brief to save as much of time as possible to solve the problems.
First problem:
https://leetcode.com/problems/minimum-area-rectangle/description/
Follow up:
https://leetcode.com/problems/minimum-area-rectangle-ii/description/
Instead of minimum area, I was asked to return largest area possible in both the problems.
I explained the optimal approach for first problem and coded the solution within 10 minutes. Then I was asked to come up with the approach for the follow up. He didn't want me to code it. I explained the optimal approach for follow up as well. Whole interview got wrapped up within 25 minutes.
I got the feedback from my recruiter very next day. I was told the feedback was very positive and we are moving to onsite interviews. Onsite has 4 interviews, out of which 3 interviews are DSA based and 1 interview is Googlyness (Behavioral). I wanted to get done with all my interviews within new year, but due to vacation season, we were not able to schedule the interviews till new year. I got my interviews scheduled around mid of January 2025.
The interviewer was from Bangalore, India office. He introduced himself and asked for my introduction. He was very clear that he will give me only 30 mins to solve the problems as he wanted 5 mins for introduction and 10 mins for any questions to ask him.
First problem:
Given an english paragraph and an integer "width", return minimum number of lines we need to print the paragraph. I was not given any example IO and was expected to come up with my own. I asked some clarifying questions like whether a word could break from a line or not. He said the word could break. Then I came up with below example and clarified if my output was correct.
paragraph: "I'm giving Google interview for L3 role"
width: 9
output: 5I explained the brute force and also the optimal approach. He asked me to code both the solutions. I coded the same.
First follow up:
Now the words should not break from a line. I clarified one possible edge case like what if there is any word in the paragraph which has more letters than the given width. He said I can assume that the width is always equal or greater than the longest word in the paragraph. I took the same example and clarified the output. Also do we need to print the space character if it's the first character of the line. He said if any line starts with a space, we need to ignore the space.
paragraph: "I'm giving Google interview for L3 role"
width: 9
output: 6I explained the optimal approach and coded the same. He asked me if we could optimize this somewhere. I know there's no possible optimization on time as I was very sure that my approach was in the best BigO possible for this problem. I found an area to optimize on space, optimized the same by modifying the code.
Second follow up:
https://leetcode.com/discuss/post/1423422/google-phone-screen-by-sharmapriyanka269-ul7w/
He explained me the problem verbally and gave the example IO for this problem. We had only 2 mins left from the 30mins problem solving window. The moment he pasted the example IO, binary search striked to my mind and I explained the same. He nodded, closed the codepad, and asked me if I have any questions for him. I asked him whether my binary search approach was correct and optimal, he said YES :)
The interviewer was from Europe. I expected some behavioral questions, but all the questions were work related. Some of the questions are,
I forgot other couple of questions. For all the negative scenario, I explained in a way that I had some alternative solution that would work. I didn't prepare much as I was expecting behavioral questions like conflict in team, etc. But then I somehow got away and managed to satisfy the interviewer.
The interviewer was from US. She greeted me with a smiling face and talked about herself and her team. She talked to me for some 3 minutes, mentioning that we would have an icebreaker session.
First problem:
Given an array of integers, find the Longest Increasing Subsequence with difference between adjacent elements as 1.
Explained both O(n^2) and O(n) and coded the optimal one.
First follow up:
Given an array of integers, find the Longest Increasing Subsequence with difference between adjacent elements atmost k. k is given.
Explained the O(nk) approach. She asked whether this could be optimized. I talked about segment tree and explained the approach. When I took the white paper to draw the segment tree to explain it in a better way, she stopped me right away and asked me to implement O(nk), saying she just wanted to know whether I could optimize it using a segment tree and that she wasn't going to ask me to implement the segment tree for the sake of this interview, which was only 45 minutes long. I coded the O(nk) solution.
Second follow up:
Same as first problem, but instead of returning just LIS as an integer, need to return the LIS list, which contains the indices of the elements in LIS.
Explained the optimal solution and coded the same. I finished coding all 3 problems exactly on 45th minute of the interview. She ended the interview officially and was talking with me for some 20 minutes. She was sorry for extending this to another 20 minutes as she wanted to give me a chance to talk to her about her experience and Google. Such good interviewers deserve a spot bonus !!
The interviewer was from US. She jumped into the problem statement directly.
https://leetcode.com/discuss/post/4263604/google-onsite-round-1-by-adityakan750-niib/
Same problem was divided into two parts.
First problem:
Don't need to care about the colors of the houses.
First follow up:
Handle with the colors of the houses.
Explained the optimal approach and coded the same for both the parts. The follow up part was more like a design problem, I created a class for house and handled the colors. Interviewer mentioned that I could choose the output format as I wish.
I got the feedback after 3 days from my last onsite round. Generally it would take atleast a week to get feedback, but my interviews were cancelled and got rescheduled 4 times due to interviewer's unavailability. These reschedules made the process a bit longer. I think because of this, my recruiter got the feedback for the interviews that happened early.
I was told that my feedback is very strong, especially in all my DSA rounds. Then I got a team fit call scheduled the very next day.
This went more like a discussion. The manager introduced himself and explained about the work and the team. I was asked about the techs I worked on and some questions.
I got a call from my recruiter after 3 days from my teamfit call to check my availability for the compensation discussion. I was not asked about my current compensation. I didn't give any other interviews and had no offers with me. I didn't negotiate and accepted the offer as the initial numbers were itself great. Offer got rolled out on the same day!
I'm kind of good at problem solving from my college days, as I used to give contest on Codeforces and Codechef. I didn't do much LC on my college days. I started grinding LC only after I decided to give it a try for Google.
CP is not necessary to crack Google as all the problems I was asked were LC medium, medium-hard type of problems. But then CP experience will come handy in interviews as it widen our thought process in a large scale and we will be aware of the value of every minute that goes past in a contest. Contest are again kind of similar to interview setup. But then you gotta explain your thoughts and think out loud in an interview. I used to take DSA sessions to my juniors when I was in college. I think this helped me a lot, to put my thoughts into words and explain it to others in a way they could understand easily.
Try to give contest in LC. While solving, try explaing the solution to yourself. Also, practice to code your solutions on Google Docs.