Mock technical interviews with an AI interviewer.
Every problem leaves something out. Ask about it before you code.
Problems
- Height of a Binary TreeGiven the root of a binary tree, return its height: the number of edges on the longest path from the root down to a leaf.EasyTreesTrees
- Insert a Value Into a Search TreeGiven the root of a binary search tree and a value, insert the value as a new leaf and return the root of the tree.EasyTreesTrees
- Tree Traversal By NameGiven a binary tree and the name of a depth-first traversal, return the node values in the order that traversal visits them.EasyTreesTrees
- Tree Values Level by LevelGiven the root of a binary tree, return its values level by level: one list for each level, from the root's level down, each level from left to right.EasyTreesTrees
- Delete a Key From a Search TreeGiven the root of a binary search tree and a key, delete the node that holds the key and return the root of the tree.MediumTreesTrees
- Inorder Without RecursionGiven the root of a binary tree, return its values in inorder (the left subtree, then the node, then the right subtree) without using recursion.MediumTreesTrees
- Is It a Search Tree?Given the root of a binary tree, return whether it is a valid binary search tree.MediumTreesTrees
- Kth Smallest in a Search TreeGiven the root of a binary search tree and an integer k, return the kth smallest value in the tree, where k = 1 means the smallest.MediumTreesTrees