Top 50 Tree Coding Problems for Interviews
Here is the collection of the Top 50 list of frequently asked interviews question on Tree. Problems in this Article are divided into three Levels so that readers can practice according to the difficulty level step by step.
Level 1
- Height of Binary Tree
- Determine if two trees are identical
- Mirror tree
- Symmetric Tree
- Diameter of tree
- Checked for Balanced tree
- Children Sum Parent
- Check for BST
- Array to BST
- Largest value in each level of binary tree
- Maximum GCD of siblings of a binary tree
- Zigzag Tree Traversal
- Inorder Successor in BST
- Kth Largest Element in a BST
Level 2
- Check if subtree
- Single Valued Subtree
- Unique BSTs
- Inorder Traversal (iterative)
- Preorder Traversal (iterative)
- Postorder Traversal(iterative)
- Vertical Traversal of a Binary Tree
- Boundary Traversal
- Construct Binary Tree from Parent array
- Construct Binary Tree from Preorder and Inorder Traversal
- Preorder Traversal and BST
- Construct tree from preorder traversal
- Minimum distance between two given nodes
- Maximum sum leaf to root path
- Odd Even Level Difference
- Lowest Common Ancestor of a Binary Tree
- Ancestors in Binary Tree
- Remove BST keys outside the given range
- Pair with given target in BST
- Sum Tree
- BST to greater sum tree
- BST to max heap
- Clone binary tree with random pointer
- Maximum sum of non adjacent nodes
- Largest BST in a Binary Tree
- Extreme nodes in alternate order
Level 3
- Connect nodes at same level
- Nodes at given distance in a Binary Tree
- Sorted Linked List to BST
- Binary Tree to Doubly Linked List
- Maximum sum path between two leaf nodes
- K-Sum Paths
- Number of turns in a binary tree
- Merge two BST’s
- Fixing two nodes of a BST
- Burn Binary Tree
Related Articles: