Google
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.

AI Powered

Share Your Story

Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.

Mock Interviews & 1:1 Guidance

Practice mock interviews or book a 1:1 call for career guidance, resume reviews, and more.

Show Your Love!

Connect with us on social media