← Nvidia questions
CodingReported in a candidate post, Aug 2024

Find the root and build a tree from parent-child pairs

Filed under Nvidia

You are given a list of (parent, child) pairs describing a tree with unique node ids. Find the root node and build the tree by linking every parent to its children. Report an error if there is not…

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

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