Panda Guru LogoPanda
Guru

Google L4 Sunnyvale | Detailed full process | Got offer

Round 1 (HR Talk)

Questions: Nothing special, just alignment with the position and if I was considering a relocation.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 2 (Google Hiring Assessment (GHA))

Questions: Behavioral questions about how I work (check some youtube videos).

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 3 (Phone interview)

Questions: Specific question not provided.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 4 (Onsite interview)

Questions:

Question 1

Given array of positive nums and a num K, select 2 ranges of size K consecutives that sum is maximized Ex: arr = {10, 20, 3, 4, 8, 19} K = 2 ans = 57 (10 + 20) + (8 + 19) I made 1 prefix sum for the first sequence and 1 suffix range max starting at >= I for the second range So I can set any idx for starting and calculate its sum in O(1) and the best second range that starts at i + k in constant time I can check among all possible idx and answer for each idx in constant time Solution O(n)

When I finished explaining my solution he said “Hey (My name), I love you, that’s great.”
Coding was smooth.
Interview finished 25 minutes earlier.
My opinion: Strong Hire.

Question 2

Warm up:

Given grid, start, end and some walls on the grid, if I can find a path (Just talk, no code)

I said “BFS” he cut me off and moved to the question.

Given same grid but now a cat position, can I find a path that's the furthest from the cat?

I double checked if I need to maximize the closest distance from the cat.
I implemented a dfs that keeps track of the closest path and get the max among all.
Follow up: improve.
He gave me a hint but I was going to find the answer anyways (he was kinda anxious and didn’t let me finish my explanation).
Binary search in the answer.
Try to find a dfs that min dist >= mid.
Follow up: multiple cats.

Overall he was super happy.
He talked a lot about what he does.
He was asking if I was interviewing for L4 because he thinks that I could apply for L5.
My opinion: Strong hire (or hire).

Question 3

Given a list of lists you need to find if you can build a consolidated array from it (only 1 array which the order that appear on it is maintained for every input array) Input: 1, 2, 15, 8 2, 4, 7, Output: true Why: 1 2 4 7 15 8 it's a possible answer because first array need the order 1 2 15 8 which is ok on the output and the order 2 4 7 it's also ok Input: 1, 6, 4 4, 1 Output: False 1 6 4 it's ok for the first one but not for the second one because 1 comes before 4 4 1 6 it's ok for the second one but not ok for the first one There is no sequence that satisfies the conditions

I started by adding the current number with index 0 second 1, third 2 …
Go to the second array and check if index of the current number > last seen.
It works for 2 arrays but not for 3+.
She gave me an example that broke my code and I had to start with a new solution.
She gave me a hint “Can you think of this as a graph?”
Then I found how to build a graph and the answer instantly.
The answer is: build a graph and check if a cycle exists.

1, 2, 15, 8 2, 4, 7, Will turns into 1 -> 2 -> 15 -> 8 \ ^ v / 4 - 7 Which doesn’t have cycle 1, 6, 4 4, 1 Will turn into 1 -> 6 -> 4 ^ / \ - - / Which has cycle

After the hint I completely destroyed the problem.
She said that it was ok my exploration to the wrong path.
Ok with the hint and got surprised that I solved super quick after the hint.
My opinion: Hire (or Strong hire).

Question 4

Googliness

My opinion: Hire? kinda hard to guess.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.