← Morgan Stanley questions

Search Node in N-ary Tree and Return Level

Filed under Morgan Stanley

Given an N-ary tree and a target value, search for the node containing the target value and return its level (depth), returning -1 if the node is not found.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.