Search
⌘K
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
Meta
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid February, 2026
Microsoft
Senior
Mid November, 2025
Microsoft
Mid-level
Early October, 2025
Amazon
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.