# Binary Tree DSA Problems

> 169 Binary Tree coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/binary-tree
Last updated: 2026-11-28

169 binary tree problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 169: 38 easy, 48 medium and 14 hard. Practise them free on InternHack and track what you have solved.

## Binary Tree problems, easiest first

1. [Average of Levels in Binary Tree](https://www.internhack.in/learn/dsa/problem/average-of-levels-in-binary-tree) (Easy)
2. [Balanced Binary Tree](https://www.internhack.in/learn/dsa/problem/balanced-binary-tree) (Easy)
3. [Binary Tree Inorder Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-inorder-traversal) (Easy)
4. [Binary Tree Paths](https://www.internhack.in/learn/dsa/problem/binary-tree-paths) (Easy)
5. [Binary Tree Postorder Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-postorder-traversal) (Easy)
6. [Binary Tree Preorder Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-preorder-traversal) (Easy)
7. [Binary Tree Tilt](https://www.internhack.in/learn/dsa/problem/binary-tree-tilt) (Easy)
8. [Closest Binary Search Tree Value](https://www.internhack.in/learn/dsa/problem/closest-binary-search-tree-value) (Easy)
9. [Convert Sorted Array to Binary Search Tree](https://www.internhack.in/learn/dsa/problem/convert-sorted-array-to-binary-search-tree) (Easy)
10. [Count Complete Tree Nodes](https://www.internhack.in/learn/dsa/problem/count-complete-tree-nodes) (Easy)
11. [Cousins in Binary Tree](https://www.internhack.in/learn/dsa/problem/cousins-in-binary-tree) (Easy)
12. [Diameter of Binary Tree](https://www.internhack.in/learn/dsa/problem/diameter-of-binary-tree) (Easy)
13. [Evaluate Boolean Binary Tree](https://www.internhack.in/learn/dsa/problem/evaluate-boolean-binary-tree) (Easy)
14. [Extract Kth Character From The Rope Tree](https://www.internhack.in/learn/dsa/problem/extract-kth-character-from-the-rope-tree) (Easy)
15. [Find a Corresponding Node of a Binary Tree in a Clone of That Tree](https://www.internhack.in/learn/dsa/problem/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree) (Easy)
16. [Find All The Lonely Nodes](https://www.internhack.in/learn/dsa/problem/find-all-the-lonely-nodes) (Easy)
17. [Find Mode in Binary Search Tree](https://www.internhack.in/learn/dsa/problem/find-mode-in-binary-search-tree) (Easy)
18. [Increasing Order Search Tree](https://www.internhack.in/learn/dsa/problem/increasing-order-search-tree) (Easy)
19. [Invert Binary Tree](https://www.internhack.in/learn/dsa/problem/invert-binary-tree) (Easy)
20. [Kth Largest Element in a Stream](https://www.internhack.in/learn/dsa/problem/kth-largest-element-in-a-stream) (Easy)
21. [Leaf-Similar Trees](https://www.internhack.in/learn/dsa/problem/leaf-similar-trees) (Easy)
22. [Maximum Depth of Binary Tree](https://www.internhack.in/learn/dsa/problem/maximum-depth-of-binary-tree) (Easy)
23. [Merge Two Binary Trees](https://www.internhack.in/learn/dsa/problem/merge-two-binary-trees) (Easy)
24. [Minimum Absolute Difference in BST](https://www.internhack.in/learn/dsa/problem/minimum-absolute-difference-in-bst) (Easy)
25. [Minimum Depth of Binary Tree](https://www.internhack.in/learn/dsa/problem/minimum-depth-of-binary-tree) (Easy)
26. [Minimum Distance Between BST Nodes](https://www.internhack.in/learn/dsa/problem/minimum-distance-between-bst-nodes) (Easy)
27. [Path Sum](https://www.internhack.in/learn/dsa/problem/path-sum) (Easy)
28. [Range Sum of BST](https://www.internhack.in/learn/dsa/problem/range-sum-of-bst) (Easy)
29. [Root Equals Sum of Children](https://www.internhack.in/learn/dsa/problem/root-equals-sum-of-children) (Easy)
30. [Same Tree](https://www.internhack.in/learn/dsa/problem/same-tree) (Easy)
31. [Search in a Binary Search Tree](https://www.internhack.in/learn/dsa/problem/search-in-a-binary-search-tree) (Easy)
32. [Second Minimum Node In a Binary Tree](https://www.internhack.in/learn/dsa/problem/second-minimum-node-in-a-binary-tree) (Easy)
33. [Subtree of Another Tree](https://www.internhack.in/learn/dsa/problem/subtree-of-another-tree) (Easy)
34. [Sum of Left Leaves](https://www.internhack.in/learn/dsa/problem/sum-of-left-leaves) (Easy)
35. [Sum of Root To Leaf Binary Numbers](https://www.internhack.in/learn/dsa/problem/sum-of-root-to-leaf-binary-numbers) (Easy)
36. [Symmetric Tree](https://www.internhack.in/learn/dsa/problem/symmetric-tree) (Easy)
37. [Two Sum IV - Input is a BST](https://www.internhack.in/learn/dsa/problem/two-sum-iv-input-is-a-bst) (Easy)
38. [Univalued Binary Tree](https://www.internhack.in/learn/dsa/problem/univalued-binary-tree) (Easy)
39. [Add One Row to Tree](https://www.internhack.in/learn/dsa/problem/add-one-row-to-tree) (Medium)
40. [All Elements in Two Binary Search Trees](https://www.internhack.in/learn/dsa/problem/all-elements-in-two-binary-search-trees) (Medium)
41. [All Nodes Distance K in Binary Tree](https://www.internhack.in/learn/dsa/problem/all-nodes-distance-k-in-binary-tree) (Medium)
42. [All Possible Full Binary Trees](https://www.internhack.in/learn/dsa/problem/all-possible-full-binary-trees) (Medium)
43. [Amount of Time for Binary Tree to Be Infected](https://www.internhack.in/learn/dsa/problem/amount-of-time-for-binary-tree-to-be-infected) (Medium)
44. [Balance a Binary Search Tree](https://www.internhack.in/learn/dsa/problem/balance-a-binary-search-tree) (Medium)
45. [Binary Search Tree Iterator](https://www.internhack.in/learn/dsa/problem/binary-search-tree-iterator) (Medium)
46. [Binary Search Tree Iterator II](https://www.internhack.in/learn/dsa/problem/binary-search-tree-iterator-ii) (Medium)
47. [Binary Search Tree to Greater Sum Tree](https://www.internhack.in/learn/dsa/problem/binary-search-tree-to-greater-sum-tree) (Medium)
48. [Binary Tree Coloring Game](https://www.internhack.in/learn/dsa/problem/binary-tree-coloring-game) (Medium)
49. [Binary Tree Level Order Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-level-order-traversal) (Medium)
50. [Binary Tree Level Order Traversal II](https://www.internhack.in/learn/dsa/problem/binary-tree-level-order-traversal-ii) (Medium)
51. [Binary Tree Longest Consecutive Sequence](https://www.internhack.in/learn/dsa/problem/binary-tree-longest-consecutive-sequence) (Medium)
52. [Binary Tree Longest Consecutive Sequence II](https://www.internhack.in/learn/dsa/problem/binary-tree-longest-consecutive-sequence-ii) (Medium)
53. [Binary Tree Pruning](https://www.internhack.in/learn/dsa/problem/binary-tree-pruning) (Medium)
54. [Binary Tree Right Side View](https://www.internhack.in/learn/dsa/problem/binary-tree-right-side-view) (Medium)
55. [Binary Tree Upside Down](https://www.internhack.in/learn/dsa/problem/binary-tree-upside-down) (Medium)
56. [Binary Tree Vertical Order Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-vertical-order-traversal) (Medium)
57. [Binary Tree Zigzag Level Order Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-zigzag-level-order-traversal) (Medium)
58. [Boundary of Binary Tree](https://www.internhack.in/learn/dsa/problem/boundary-of-binary-tree) (Medium)
59. [Change the Root of a Binary Tree](https://www.internhack.in/learn/dsa/problem/change-the-root-of-a-binary-tree) (Medium)
60. [Check Completeness of a Binary Tree](https://www.internhack.in/learn/dsa/problem/check-completeness-of-a-binary-tree) (Medium)
61. [Check If Two Expression Trees are Equivalent](https://www.internhack.in/learn/dsa/problem/check-if-two-expression-trees-are-equivalent) (Medium)
62. [Clone Binary Tree With Random Pointer](https://www.internhack.in/learn/dsa/problem/clone-binary-tree-with-random-pointer) (Medium)
63. [Closest Leaf in a Binary Tree](https://www.internhack.in/learn/dsa/problem/closest-leaf-in-a-binary-tree) (Medium)
64. [Closest Nodes Queries in a Binary Search Tree](https://www.internhack.in/learn/dsa/problem/closest-nodes-queries-in-a-binary-search-tree) (Medium)
65. [Complete Binary Tree Inserter](https://www.internhack.in/learn/dsa/problem/complete-binary-tree-inserter) (Medium)
66. [Construct Binary Search Tree from Preorder Traversal](https://www.internhack.in/learn/dsa/problem/construct-binary-search-tree-from-preorder-traversal) (Medium)
67. [Construct Binary Tree from Inorder and Postorder Traversal](https://www.internhack.in/learn/dsa/problem/construct-binary-tree-from-inorder-and-postorder-traversal) (Medium)
68. [Construct Binary Tree from Preorder and Inorder Traversal](https://www.internhack.in/learn/dsa/problem/construct-binary-tree-from-preorder-and-inorder-traversal) (Medium)
69. [Construct Binary Tree from Preorder and Postorder Traversal](https://www.internhack.in/learn/dsa/problem/construct-binary-tree-from-preorder-and-postorder-traversal) (Medium)
70. [Construct Binary Tree from String](https://www.internhack.in/learn/dsa/problem/construct-binary-tree-from-string) (Medium)
71. [Construct String from Binary Tree](https://www.internhack.in/learn/dsa/problem/construct-string-from-binary-tree) (Medium)
72. [Convert Binary Search Tree to Sorted Doubly Linked List](https://www.internhack.in/learn/dsa/problem/convert-binary-search-tree-to-sorted-doubly-linked-list) (Medium)
73. [Convert BST to Greater Tree](https://www.internhack.in/learn/dsa/problem/convert-bst-to-greater-tree) (Medium)
74. [Convert Sorted List to Binary Search Tree](https://www.internhack.in/learn/dsa/problem/convert-sorted-list-to-binary-search-tree) (Medium)
75. [Correct a Binary Tree](https://www.internhack.in/learn/dsa/problem/correct-a-binary-tree) (Medium)
76. [Count Good Nodes in Binary Tree](https://www.internhack.in/learn/dsa/problem/count-good-nodes-in-binary-tree) (Medium)
77. [Count Nodes Equal to Average of Subtree](https://www.internhack.in/learn/dsa/problem/count-nodes-equal-to-average-of-subtree) (Medium)
78. [Count Nodes Equal to Sum of Descendants](https://www.internhack.in/learn/dsa/problem/count-nodes-equal-to-sum-of-descendants) (Medium)
79. [Count Nodes With the Highest Score](https://www.internhack.in/learn/dsa/problem/count-nodes-with-the-highest-score) (Medium)
80. [Count Univalue Subtrees](https://www.internhack.in/learn/dsa/problem/count-univalue-subtrees) (Medium)
81. [Cousins in Binary Tree II](https://www.internhack.in/learn/dsa/problem/cousins-in-binary-tree-ii) (Medium)
82. [Create Binary Tree From Descriptions](https://www.internhack.in/learn/dsa/problem/create-binary-tree-from-descriptions) (Medium)
83. [Deepest Leaves Sum](https://www.internhack.in/learn/dsa/problem/deepest-leaves-sum) (Medium)
84. [Delete Leaves With a Given Value](https://www.internhack.in/learn/dsa/problem/delete-leaves-with-a-given-value) (Medium)
85. [Delete Node in a BST](https://www.internhack.in/learn/dsa/problem/delete-node-in-a-bst) (Medium)
86. [Delete Nodes And Return Forest](https://www.internhack.in/learn/dsa/problem/delete-nodes-and-return-forest) (Medium)
87. [Binary Tree Cameras](https://www.internhack.in/learn/dsa/problem/binary-tree-cameras) (Hard)
88. [Binary Tree Maximum Path Sum](https://www.internhack.in/learn/dsa/problem/binary-tree-maximum-path-sum) (Hard)
89. [Build Binary Expression Tree From Infix Expression](https://www.internhack.in/learn/dsa/problem/build-binary-expression-tree-from-infix-expression) (Hard)
90. [Closest Binary Search Tree Value II](https://www.internhack.in/learn/dsa/problem/closest-binary-search-tree-value-ii) (Hard)
91. [Cycle Length Queries in a Tree](https://www.internhack.in/learn/dsa/problem/cycle-length-queries-in-a-tree) (Hard)
92. [Height of Binary Tree After Subtree Removal Queries](https://www.internhack.in/learn/dsa/problem/height-of-binary-tree-after-subtree-removal-queries) (Hard)
93. [Maximum Sum BST in Binary Tree](https://www.internhack.in/learn/dsa/problem/maximum-sum-bst-in-binary-tree) (Hard)
94. [Merge BSTs to Create Single BST](https://www.internhack.in/learn/dsa/problem/merge-bsts-to-create-single-bst) (Hard)
95. [Minimum Flips in Binary Tree to Get Result](https://www.internhack.in/learn/dsa/problem/minimum-flips-in-binary-tree-to-get-result) (Hard)
96. [Number of Ways to Reorder Array to Get Same BST](https://www.internhack.in/learn/dsa/problem/number-of-ways-to-reorder-array-to-get-same-bst) (Hard)
97. [Recover a Tree From Preorder Traversal](https://www.internhack.in/learn/dsa/problem/recover-a-tree-from-preorder-traversal) (Hard)
98. [Serialize and Deserialize Binary Tree](https://www.internhack.in/learn/dsa/problem/serialize-and-deserialize-binary-tree) (Hard)
99. [Subtree Removal Game with Fibonacci Tree](https://www.internhack.in/learn/dsa/problem/subtree-removal-game-with-fibonacci-tree) (Hard)
100. [Vertical Order Traversal of a Binary Tree](https://www.internhack.in/learn/dsa/problem/vertical-order-traversal-of-a-binary-tree) (Hard)

## Companies that ask binary tree problems

- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 82 of these problems
- [Google](https://www.internhack.in/learn/dsa/companies/google): 82 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 71 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 62 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 51 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 20 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 18 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 17 of these problems
- [Linkedin](https://www.internhack.in/learn/dsa/companies/linkedin): 16 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 14 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 14 of these problems
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs): 10 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
