Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
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:
Meta
Amazon
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid November, 2025
Microsoft
Mid-level
Early October, 2025
Amazon
Mid-level
Mid April, 2025
Meta
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.