Google
Software Development Engineer 3
Merge N-ary Trees
Hard
Onsite 3codingCandidate Selected
You are given two n-ary trees where every node has a key and a value. Merge them into a single tree. If the same key exists in both trees, B's value wins. For matching nodes, merge their children similarly with A's children first, followed by B's leftovers.
This question was asked in
Google Software Development Engineer 3 Interview Experience
I had a comprehensive interview experience with Google that spanned five rounds, including phone screens and onsite interviews. The questions covered various topics such as data structures and algorithms, graphs, strings, and trees, along with behavioral assessments. Overall, the difficulty was medium, and the experience was intense but insightful.