Phase 2 Exit Criteria & Projects

You don’t leave Phase 2 because the calendar says so. You leave when you can demonstrate the following three things, specifically, under timed conditions. If you can’t pass these checks, extend the phase. Rushing forward with gaps in recursion and trees is how you hit a wall in Phase 3 and beyond.


Exit Criteria (Measurable, Not Vibes-Based)

Criterion 1: Traversal Fluency

Given any binary tree problem, classify it as top-down or bottom-up recursion within 2 minutes, without solving it.

Top-down (pass state down the call stack): the computation needs context from ancestors. You compute something at the current node using information passed from the parent. Path sum, path root-to-leaf, checking constraints that depend on where you are in the tree.

Bottom-up (aggregate return values up): the computation at each node depends on what its children report. Max depth, diameter, any problem where you combine left and right subtree answers. Most tree problems are bottom-up.

The test: open 10 random tree problems on LeetCode. For each, write only: “top-down” or “bottom-up” and a one-line reason. Don’t implement. Time yourself: 2 minutes max per problem. You pass when you’re right 9/10 times.


Criterion 2: Binary Search on Answer Space

Given a novel monotone problem, apply the search-on-answer technique and implement a correct binary search in under 30 minutes.

The test problem: LC 1552 (Magnetic Force Between Two Balls), or LC 1870 (Minimum Speed to Arrive on Time), or LC 2064 (Maximized Grid Happiness). Any problem you haven’t seen before that has the form “minimize/maximize X such that [feasibility condition that is monotone in X].”

Pass condition: you recognize the pattern, define the search space and feasibility function, implement the binary search with correct off-by-one handling, and submit a passing solution. All within 30 minutes, for a problem you’re encountering for the first time.


Criterion 3: Tree Hard Competency

Solve 3 LeetCode Hard tree problems with an average independent solve time under 45 minutes.

“Independent” means no hints, no editorial, no looking up similar problems. You may look up syntax. After each solve, you can check the editorial to compare approaches — that’s learning, not cheating. The solve time is before you look at any hints.

Suggested test set (pick any 3):

  • LC 124 — Binary Tree Maximum Path Sum

  • LC 297 — Serialize and Deserialize Binary Tree

  • LC 99 — Recover BST

  • LC 212 — Word Search II

  • LC 685 — Redundant Connection II


Projects

These are not optional exercises. They’re the mechanism that converts reading into competence. Each has a concrete acceptance criterion. If you can satisfy the criterion, you’ve built something. If you can’t, you haven’t understood the concept as well as you thought.


Project 1: Tree Visualizer

What: Write a function that takes a TreeNode (Java) and prints it as ASCII art in a form that makes the structure unambiguous. Any tree, any shape.

Why: You can’t visualize recursion if you can’t visualize the tree. Every debugging session for every tree problem will go faster once you can print the tree. This is a tool you’ll use for the rest of your preparation.

Minimum viable output for the tree [1, 2, 3, 4, 5, null, 6]:

        1
       / \
      2   3
     / \   \
    4   5   6

Harder output (aim for this): draw it level by level with proper spacing that scales with tree depth. The challenge is the horizontal spacing math.

Acceptance criterion: Given any binary tree (including degenerate single-branch trees, complete trees, and trees with one child per node), your output is unambiguous about the structure. Show it to a colleague or yourself the next morning — can you reconstruct the tree from the output alone?

Starting point: implement BFS level-order to collect nodes per level. Handle null nodes as spaces. The spacing is the challenge: 2^(maxDepth - level) spaces between nodes at any given level.


Project 2: LeetCode 25-Problem Sprint

Format: 5 easy + 15 medium + 5 hard, all from the trees, recursion, and backtracking categories.

Tracking: For each problem, record: (1) time taken, (2) did you solve independently (Y/N), (3) one sentence naming the core pattern used.

Suggested problem list:

Easy (5): LC 104, LC 226, LC 112, LC 700, LC 111

Medium (15): LC 102, LC 105, LC 106, LC 543, LC 437, LC 236, LC 98, LC 230, LC 337, LC 46, LC 78, LC 77, LC 39, LC 208, LC 211

Hard (5): LC 124, LC 297, LC 99, LC 51, LC 212

Acceptance criterion: at least 20 of 25 solved independently (80%). For the 5 you needed help with, write a post-mortem: “I got stuck because X, the insight I missed was Y, pattern for next time is Z.” Don’t skip the post-mortems — that’s where the actual learning happens.

Pacing: roughly 3-4 problems per day over the phase. Don’t do them all at the end.


Project 3: “Why Does This Work?” Document

What: Pick 5 backtracking problems. For each one, write the following before looking at any code:

  1. The decision tree: draw (or ASCII-sketch) the first 2-3 levels

  2. The choice at each node: what exactly are you deciding?

  3. The base case: when do you stop and record a solution?

  4. The pruning conditions: what makes a branch dead?

  5. What the current state represents at any given point in the recursion

Then implement, run, and verify.

Why this format: backtracking is the algorithm most hurt by copying solutions without understanding. The decision tree prose forces you to think before coding. The 5 problems should represent different patterns:

  1. Subsets (no constraint, record at every node)

  2. Combination Sum (sum constraint, elements reusable)

  3. Permutations (order matters, used-array tracking)

  4. N-Queens (spatial constraints, diagonal encoding)

  5. Word Search (grid backtracking, 2D movement)

Acceptance criterion: give your document to someone who knows backtracking but hasn’t seen these specific problems. If they can implement a working solution from your document alone (without your code), you’ve written a good document. If you can’t find someone, re-read your own document 3 days later and verify you could implement from it cold.


Week-by-Week Micro-Schedule (Weeks 12–18)

Phase dates: October 19 – November 29, 2026

Week 12 (Oct 19–25): Recursion Foundations

  • Read 01_recursion_mechanics.md in full. Do not skim.

  • Complete all 6 practice exercises from that file: factorial, Fibonacci + memo, power, flatten, count paths, generate subsets

  • Spend extra time on the subsets exercise — that’s a backtracking preview

  • Deliverable: can implement and explain the call stack for all 6 exercises

Week 14 (Nov 2–8): Binary Trees

  • Read 03_binary_trees.md

  • Implement all traversals: inorder recursive, inorder iterative, preorder, postorder, BFS level-order

  • Complete practice problems 1-6 from the file

  • Deliverable: LC 543 (Diameter) solved — if you can get the global-max vs return-value distinction right, you’ve got the pattern

Week 15 (Nov 9–15): BST + Backtracking

  • Read 04_binary_search_trees.md and 05_backtracking.md

  • Implement BST insert/search/delete from scratch

  • Complete BST problems 1-4

  • Start backtracking: implement Subsets and Permutations with the template from memory

  • Deliverable: BST validation (LC 98) and Subsets (LC 78) both solved independently

Week 16 (Nov 16–22): Backtracking Deep + Tries

  • Complete backtracking problems 3-6 (Combinations, Combination Sum, Subsets II, N-Queens)

  • Read 06_tries.md

  • Implement Trie from scratch (LC 208)

  • Complete trie problems 1-3

  • Start Project 3: “Why Does This Work?” document for problems 1-3 (Subsets, Combination Sum, Permutations)

  • Deliverable: N-Queens (LC 51) solved with diagonal optimization

Week 17 (Nov 23–28): Sprint + Projects

  • Complete the 25-problem LeetCode sprint (you should have ~15 problems done already from previous weeks, finish the remaining)

  • Complete Project 3: add N-Queens and Word Search to the document

  • Build Tree Visualizer (Project 1) — give it a full day, it’s worth the time

  • Deliverable: sprint at 80%+ independent, visualizer outputs correct ASCII for 5 different tree shapes

Week 18 (Nov 29): Exit Gate

  • Run exit criteria checks 1, 2, 3 in sequence

  • If any criterion fails, take one more week and address the specific gap

  • Do not advance to Phase 3 until you can pass all three


A note on pacing: this schedule is tight with a full-time job at 10-15 hours/week. If Week 14 runs long because trees are clicking slowly, absorb time from Week 17 rather than skipping problems. The sprint is the place to catch up on volume, not the place to first encounter a pattern.