Leetcode 863. All Nodes Distance K in Binary Tree
Given a binary tree and a target node value, return all node values at distance K from the target. The challenge is to traverse both downwards and upwards (treat the tree as an undirected graph or add parent pointers) and perform a breadth-/depth-first search to collect nodes exactly K edges away.
Asked at:
Microsoft
Amazon
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early March, 2026
Meta
Staff
Mid February, 2026
Senior
Mid November, 2025
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.