Search
⌘K
Get Premium
Leetcode 272. Closest Binary Search Tree Value II
Given a BST, a real-valued target and an integer k, return the k node values in the tree closest to the target. The challenge is to exploit BST ordering to produce those k nearest values efficiently (better than a full traversal), typically by generating sorted predecessors and successors and merging them.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late October, 2025
Senior
Late April, 2025
Amazon
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.