Top 50 Tree Coding Problems for Interviews
Last Updated :
21 Feb, 2025
Improve
Here is the collection of the Top 50 list of frequently asked interview questions on Tree. Problems in this Article are divided into three Levels so that readers can practice according to the difficulty level step by step.
Easy Problems
- 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
Medium Problems
- 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
Hard Problems
- 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
- Top 50 Array Coding Problems for Interviews
- Top 50 String Coding Problems for Interviews
- Top 50 Dynamic Programming Coding Problems for Interviews
- Top 50 Graph Coding Problems for Interviews
- Top 50 Sorting Coding Problems for Interviews
- Top 50 Searching Coding Problems for Interviews
- Top 50 Binary Search Tree Coding Problems for Interviews
Some other important Tutorials:
- DSA Tutorial
- System Design Tutorial
- Software Development Roadmap
- Roadmap to become a Product Manager
- Learn SAP
- Learn SEO