โ† Amazon questions

Print kth node at every kth level of an n-ary tree

Filed under Amazon

Given an n-ary tree, for every level i (1-indexed), print the kth node if it exists; otherwise, print the last node of that level.

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

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