Day 70: Mastering Recursion – From Basics to Brilliance ![]()
Recursion can be intimidating at first, but once it clicks, it becomes one of the most elegant and powerful tools in your coding arsenal. Whether you’re prepping for FAANG interviews or sharpening your CS fundamentals, mastering recursion is a must.
I’m sharing a curated list of Top Recursion Problems on LeetCode – sorted from beginner to advanced – that helped me build confidence and intuition. Let’s dive in! ![]()
Beginner Level – Build the Foundation
Start here to grasp the core concept: a function calling itself with a smaller input, and a base case to stop recursion.
Factorial of N – Implement the classic definition
LeetCode Recursion Basics
(Not a specific problem, but use this page to practice basics like factorial, power, and sum of array recursively)
Reverse a String
344. Reverse String
Fibonacci Number (Top-down vs. Bottom-up)
509. Fibonacci Number
Intermediate Level – Brute Force to Backtracking
Here’s where recursion gets interesting. You’ll encounter decision trees and multiple recursive calls.
Permutations
46. Permutations
Subsets (Power Set)
78. Subsets
Generate Parentheses – Backtracking meets recursion
22. Generate Parentheses
Letter Combinations of a Phone Number
17. Letter Combinations of a Phone Number
Advanced Level – Recursion with Pruning & State Tracking
Here we combine recursion with optimization tricks (memoization, state flags, etc.)
Word Search
79. Word Search
N-Queens – Classic CS problem
51. N-Queens
Palindrome Partitioning
131. Palindrome Partitioning
Restore IP Addresses
93. Restore IP Addresses
Expression Add Operators – Deep backtracking with arithmetic
282. Expression Add Operators
Bonus: Visual Tools to Learn Recursion
Use a debugger or draw recursion trees on paper.
Try Python Tutor: http://pythontutor.com/
Memoize and compare brute force vs. optimized versions.
Final Thoughts
Recursion isn’t just a topic — it’s a mindset. Tackling it daily rewires your brain to think declaratively. And as always, happy coding!