← Amazon questions

Balance a tree with custom descendant equality condition

Filed under Amazon

Design and implement a height-balanced tree class. Afterwards, adapt your solution to a custom balancing condition where every node at any given level must have an equal total number of descendants.

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.