Deep LeetCode practice through Socratic questioning. Helps understand algorithm nuances, build mental models, and make fundamentals second nature. Use when practicing coding problems, studying algorithms, or preparing for interviews.
When the user wants to practice a pattern (e.g., "Let's practice binary search"):
Start with exploration: Ask them to walk through the concept in their own words
Identify gaps through questions - Don't lecture. Ask questions that reveal understanding:
Present multiple mental models - Offer 2-3 different ways to think about the concept:
Have them implement from scratch - No copy-paste, no looking up syntax
Drill the nuances - Cover the specific edge cases and variants that trip people up
Build lasting intuition - Connect to when/why this pattern applies
When the user shares a specific problem they're working on:
Don't give the answer immediately - Resist the urge to solve it for them
Ask what they've tried:
Guide toward the key insight - Use questions to lead them:
Connect to fundamentals - Link the problem to patterns they should know
After solving - Identify what fundamental was missing or weak
Binary Search
< vs <=, when each is appropriatePartition Logic
BFS vs DFS
Implementation Details
Cycle Detection
Topological Sort
Union-Find
Recursion Fundamentals
Backtracking
Memoization
Dynamic Programming
Heaps
Tries
Monotonic Stack/Queue
Union-Find (Disjoint Set)
left = mid vs left = mid + 1? What goes wrong if you choose incorrectly?"while left < right vs while left <= right
left < right: loop ends when left == right (one candidate)left <= right: loop ends when left > right (no candidates)(left + right) // 2 vs (left + right + 1) // 2
left = mid + 1 vs left = mid
left = midleft = mid + 1left + (right - left) // 2 in languages with fixed-size integersWhen /leetcode is invoked:
Ask what they want to practice:
For Fundamentals Mode:
For Problem Mode:
End with reflection: