Google L4 Interview Experience
Summary
I shared my experience interviewing for an L4 role at Google, detailing multiple rounds that were generally positive and collaborative, although I sometimes struggled with optimal solutions or advanced follow-up questions. I received positive feedback despite some noted areas for improvement.
Full Experience
Positive. The interviewer was enthusiastic and collaborative. The interview felt more like a discussion than a questioning. I was able to voice my thoughts well due to the collaborative nature of the interview, come up with an optimal approach, and then code it up quite quickly. At the end as a followup interviewer asked if there are other optimisations possible, and as I was trying to find it out, time ran out. (PS: I still do not know what optimisation is possible on my approach :P). I received a positive feedback, with a note that I was not able to reach the most optimal solution but the solution was optimal enough as the BigO complexity was the same.Neutral. The interviewer gave the question, and as I was working through my thoughts on the solutions, the interviewer asked questions about my approach. I was able to explain my thoughts and once the interviewer was satisfied, I went ahead to coding. Post my code, interviewer identified some edge cases which were not addressed, which I then addressed in my code as well. Then interviewer asked if I can optimise it even further. Here I was slightly stuck and the interviewer had to give a hint, post which I was able to figure out the most optimal solution, and then code it. I was barely able to finish the code and dry run, with just 1 minute left in my interview time. I had to write code for two different approaches in this round which led to improper time management on my part. Feedback was positive, with a note that debugging and edge case handling was lacking.Very Positive. The interviewer was very enthusiastic and collaborative. Once the question was given, I started with clarifying questions to ensure I understood the question. Some of my clarifying questions were appreciated by the interviewer as identifying the gaps in the question. I came up with an approach and interviewer was satisfied with the approach. I went ahead to coding, and then interviewer asked for dry run with multiple sample inputs. Within this discussion, I corrected some small bugs, and made the code more readable and improved the understandability of the code. I then realised that there is an optimisation possible which would greatly improve the complexity of my solution. I mentioned this to the interviewer, and he said while there is a more optimal approach, he is satisfied with my current approach. In this round, even though I did not code the most optimal approach, due to the highly collaborative and feedback driven round, my experience was positive, and the interviewer also gave a very positive feedback.Neutral. I started with a lot of clarifying questions to make sure I have the right understanding of the problem. I then explained a basic approach, which the interviewer was satisfied with. However, I came up with the solution very quickly and therefore instead of coding the first approach, he asked me the follow up question, and once I gave the approach for that, he asked me to code that approach. I completed the code for that approach. The interviewer went through the code very minutely, and had a lot of questions regarding the code to understand it better. This took a good amount of time. Once he was satisfied with my code, he then asked me the second follow up. This follow-up was challenging for me, and I was unable to come up with a solution for the follow-up in the interview time. I did however come up with the optimal solution on my own right after the interview ended. Therefore this was also an area of my time-management which I could have improved. I took a long time to explain my code and approach for the first follow-up because I did not think there would be another follow-up. My feedback was positive, with a note that my debugging skills are slightly lacking. I am not sure why this feedback note was there as we did not identify or fix any bugs. The dry runs were also all successful. It is possible that I truly missed a bug, but it was never mentioned in the interview itself.
Interview Questions (4)
There are a number of cakes laid out on a table. Each cake is square in shape, and its edges are placed parallel to the edge of the table. The location and size of each cake is given to you. There is a large horizontal blade over the table that can cut across all the width of the table. Find the exact vertical position of the blade so that it divides all of the cake material into two equal portions.
Input: A List where class Cake { double x; double y; double side; }
Output: double, the distance from the top edge of the table at which you make the cut.
Input: [Cake(x=1.0, y=0.0, side=2.0), Cake(x=4.0, y=0.0, side=2.0)] Output: 1.0
0 1 2 3 4 5 6 0 +---+---+---+---+---+---+---+ | | X | X | | X | X | | 1 +---+---+---+---+---+---+---+ | | X | X | | X | X | | 2 +---+---+---+---+---+---+---+ | | | | | | | | 3 +---+---+---+---+---+---+---+
Input: [Cake(x=1.0, y=0.0, side=2.0), Cake(x=4.0, y=1.0, side=2.0)] Output: 1.5
0 1 2 3 4 5 6 0 +---+---+---+---+---+---+---+ | | X | X | | | | | 1 +---+---+---+---+---+---+---+ | | X | X | | X | X | | 2 +---+---+---+---+---+---+---+ | | | | | X | X | | 3 +---+---+---+---+---+---+---+
Given a list of strings as input, group strings such that any two strings in a group are buddies with each other. Two strings are buddies with each other if every character in the first string is equidistant from the character at the corresponding index of the second string.
Example 1: Input: ["abc", "def", "pat", "qbu"] Output: [["abc","def"], ["pat","qbu"]]
Example 2: Input: [ "az", "zy","cat","bzs"] Output: [["az","zy"], ["cat","bzs"]]
Given a sample input which shows data of team members' on call rotation, where the onCall timings for team members are given based on member name, transpose this data such that onCall timings are shown based on onCall intervals, where all people onCall during that interval are shown for that interval.
Sample input:
| Name | Start | End |
|---|---|---|
| Abby | 10 | 100 |
| Ben | 50 | 70 |
| Carla | 60 | 120 |
| David | 150 | 300 |
| Abby | 120 | 150 |
Sample output:
| Start | End | Names |
|---|---|---|
| 10 | 50 | Abby |
| 50 | 60 | Abby, Ben |
| 60 | 70 | Abby, Ben, Carla |
| 70 | 100 | Abby, Carla |
| 100 | 120 | Carla |
| 150 | 300 | David |
There’s a shop selling n items, in which the i-th item has an integer id_i and will be available from time point a_i to b_i. Assume you have a list of ids of some items to buy. Find a time point that you can buy all the items in your list.
Example:
n = 3 Item 1: id_1 = 1, a_1 = 1, b_1 = 10 Item 2: id_2 = 2, a_2 = 4, b_2 = 6 Item 3: id_3 = 3, a_3 = 6, b_3 = 8
Your list: L = (1, 2) → One possible solution: t = 4.
Follow up:
- What if there are multiple entries for the same itemId?
- What if the required list has duplicate itemIds. Duplicates mean the itemId has to purchased multiple times (as many times as its repeated, each purchase from a different time slot).