← Google questions

N-ary tree preorder traversal and reconstruction

Filed under Google

Traverse an N-ary tree in preorder, serializing each node's value and its child count into a representation, then reconstruct the original N-ary tree from that serialized output.

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

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