Panda Guru LogoPanda
Guru

Google | L3 | Germany/Switzerland | Jan 2025

Round 1: Phone Interview

Questions: Word for word this question, just that the result was not the earliest time when everyone to becomes friends, but for a group of people, given in a set, to become friends The Earliest Moment When Everyone Become Friends.

Candidate's Approach

Solution: Union find, or I guess you might be able to do it with multiple DFSs.

Interviewer's Feedback

No feedback provided.


Round 2: Onsite 1

Questions: This question, but worded a bit differently. It was asking for the shortest unionized path from what I remember.

Candidate's Approach

Solution: 1 BFS from Alice, 1 BFS from Bob, 1 BFS from Destination, to find minimum distances to all nodes starting from Alice, Bob, Destination, loop through nodes and find the minimum sum aDistances.get(node) + bDistances.get(node) + dDistances.get(node).

Interviewer's Feedback

No feedback provided.


Round 3: Onsite 2

Questions: I haven't seen this question yet. Nodes in a tree are represented as:

class Node { int pIndex; String value; }

The tree itself is given to you as Node[] tree, where the pIndex (parent index) of every node at i is smaller than i (pretty much means that the parent of each node is before the node itself in the array). You need to implement a method "void eraseNodes(Node[] tree, Set toErase)" that will erase the nodes from the indexes in toErase + its children in-place. You should not have nodes that are deleted between nodes that remain in the final array. So you need for example to have the remaining nodes at indexes [i, j] and the deleted ones, set to null, at indexes [j + 1, tree.length - 1].

Candidate's Approach

Solution: I gave a solution where I have a switchTimes integer that I increment when I find a node that is at an index inside toErase or when the pIndex of the node is in toErase. I also add the node's index to toErase if only its pIndex is inside toErase. For nodes whose index is not in toErase and their pIndex is also not in toErase, I just swap them with index i - switchTimes. The interviewer pointed out that you also need to update the pIndex of non-deleted nodes, you would do this with a map, but I didn't have enough time to code that part out.

Interviewer's Feedback

No feedback provided.


Round 4: Onsite 3

Questions: You are given an MxN integer matrix where matrix[i][j] = elevation at that position. From every position you can move up/down/left/right and your goal is to return the path from (0,0) to (m-1,n-1) where the maximum elevation of the path is minimal. The maximum elevation of a path is the maximum elevation found on that path. Very similar to Swim in Rising Water.

Candidate's Approach

Solution: I gave a solution with Dijkstra where I push elements of the form {i, j, curMaxElevation} to a PriorityQueue, where for every neighbor the nextMaxElevation = max(curMaxElevation, matrix[i][j]), and return the curMaxElevation when we are at position (m-1,n-1). The interviewer said the solution is good, just that we don't need to push the curMaxElevation to the pq, but rather have just {i, j} on the pq, and on each iteration extract the {i, j} with the minimum matrix[i][j] from the pq. I coded that too.

Interviewer's Feedback

No feedback provided.


Round 5: Googliness

Questions: Usual questions similar to Googliness Frequently Asked Questions.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Recommendations

Overall, I hope I did enough. Hope that I don't need to be absolutely perfect to get an offer. I will post the feedback when I get it. Now I really need to take a break for a while because whenever I type the letter 'n' in my browser's search bar neetcode comes up before Netflix and I don't like that.

Good luck to you all! :D