Find All Tree Nodes at Distance K
Company: Apple
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: Return every binary-tree node exactly k undirected edges from a target node, sorted by value for deterministic output. Use node identity despite duplicate values and handle missing targets, empty trees, zero distance, and distances beyond the tree.
Read the full Apple Software Engineer interview experience this question came from