Loading…
Every trees problem we index, grouped by the curriculum module that teaches its pattern. Each problem ships with multiple approaches, complexity analysis, and a line-by-line walkthrough in Java and Python.
Grouped by curriculum module
Trees guide
Overview
Trees is hierarchical structures that are the natural home of recursion and traversal, and it shows up very frequently in technical interviews. Tree questions test recursion, the three DFS orders, BFS by level, and reasoning about subtree state.
Our library indexes 41 Trees problems (18 easy, 18 medium, 5 hard), each solved brute-force → optimal in Java and Python with a line-by-line walkthrough and interview talking points. They're grouped below by the curriculum module that teaches the underlying pattern, so related problems reinforce one another.
If you remember one thing about Trees, make it this: Almost every tree problem is 'solve the subtrees, then combine' — define what each recursive call returns. Once that clicks, the signature patterns — DFS (pre/in/post-order), BFS, divide & conquer — start to feel like a checklist you run on every new problem.
Study playbook
Common pitfalls
Frequently asked
Keep exploring