Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1–6
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…
Companies: Amazon, LinkedIn
Binary Search Tree · Binary Tree · Depth-First Search · Heap (Priority Queue)
Last reported Sep 2026
Determine whether a binary tree is a valid binary search tree by checking that each node's value is strictly greater than all values in its…
Companies: Amazon, Lyft, Microsoft
Binary Search Tree · Binary Tree · Depth-First Search · Tree
Last reported Aug 2026
Given a Binary Search Tree and a target numeric value, return the value of the node in the tree that is closest to the target…
Companies: Expedia, Meta, Roblox
Binary Search · Binary Search Tree · Binary Tree · Depth-First Search
Last reported Jun 2026
Return the k-th smallest value (1-indexed) in a BST — exploit that an in-order traversal yields values in sorted order and pick the k-th visited…
Companies: Amazon, Google, Meta, Uber
Binary Search Tree · Binary Tree · Depth-First Search · Tree
Last reported Mar 2025
Given a BST root and a value not already present, insert the value as a new leaf in the correct position to preserve BST ordering…
Companies: Anduril, LinkedIn
Binary Search Tree · Binary Tree · Tree
Last reported Feb 2025
Transform a BST so each node's value becomes its original value plus the sum of all keys greater than it; this is typically done with…
Companies: Apple
Binary Search Tree · Binary Tree · Depth-First Search · Tree