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
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early October, 2025

Amazon
Mid-level
Mid April, 2025
Meta
Mid-level
Early April, 2025
Meta
Mid-level
Your account is free and you can post anonymously if you choose.