← Goldman Sachs questions

Find Magic parents in a binary tree

Filed under Goldman Sachs

Given a binary tree, identify all 'magic parent' nodes. A magic parent is defined as a node where one of its child subtrees has an even sum and the other child subtree has an odd sum. If a child is…

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 Goldman Sachs questions

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