Google Interview experience
2 rounds over 3 weeks. No offer, meh experience.
We talked about my past experiences and the role that I was interviewing for. Gave me tips on preparing by doing leetcode problems and brushing up on data structures and algorithms. Was told to think aloud during the interview, and ask for clarifications.
I was asked to invert a binary tree in a shared google doc. Pretty standard leetcode problem.
Problem: Given the root of a binary tree, invert the tree and return the new root
Approach: Inverting requires swapping the left and right children of all nodes in the tree. Need to use a queue (BFS) to process each node, swap its children, and then add those children to the queue for further processing.
Example:
4
/ \
2 7
/ \ / \
1 3 6 9Output:
4
/ \
7 2
/ \ / \
9 6 3 1Know someone interviewing at Google? Pass it on.
Same company, different candidates.
Share yours while it’s fresh. It takes five minutes, it’s anonymous, and it will help future candidates.