Interview prep
Learn Binary Trees & Algorithms in 6 weeks
Week by week
- Duration
- 6 weeks
- Phases
- 3
- Topics
- 6
- Tasks
- 14
Goal: Solve binary tree interview problems under time pressure and explain their complexity.
1. Traversals
Weeks 1–2Depth-first traversal
- Implement preorder, inorder and postorder recursively
- Rewrite inorder iteratively with an explicit stack
Breadth-first traversal
- Return level-order values as nested arrays
- Find the right side view of a tree
2. Binary search trees
Weeks 3–4BST operations
- Insert, search and delete in a BST
- Validate a BST with min and max bounds
- Find the k-th smallest element
Balanced trees
- Check whether a tree is height-balanced in O(n)
- Build a balanced BST from a sorted array
3. Interview patterns
Weeks 5–6Path and ancestor problems
- Lowest common ancestor in a binary tree
- Maximum path sum
- Serialize and deserialize a tree
Timed practice
- Solve four medium problems in 30 minutes each
- Run one mock interview and review the recording