🚀 Phases 1–5 are live — Days 1–17 cover the foundations and the algorithmic patterns. See the roadmap →
Day 14 - Dynamic ProgrammingPractice QuestionsOverview

DP Practice Questions

Ten interview classics. Each one is a direct application of one of the seven classic patterns or an advanced technique — once you spot the pattern, the state writes itself.

Before reading any solution, force yourself through the state-design checklist:

  1. What am I computing? (English sentence)
  2. What are the dimensions of the state?
  3. What are the base cases?
  4. What’s the transition?
  5. What order do I fill the table?

The code is a 10-line transcription of those five answers. If you can answer them, you’ve solved the problem.

Easy

ProblemPatternStatus
Climbing Stairs1D linear (Fibonacci-shaped)Available
House Robber1D linear (skip/take)Available

Medium

ProblemPatternStatus
Coin ChangeUnbounded knapsack (min)Available
Longest Increasing SubsequenceLIS — O(n²) and O(n log n)Available
Longest Common Subsequence2D string DPAvailable
0/1 KnapsackSubset selection with weight limitAvailable
Partition Equal Subset SumSubset sum (knapsack reduction)Available
Word BreakUnbounded knapsack on stringsAvailable
Maximum Product SubarrayKadane variant — track min and maxAvailable

Hard

ProblemPatternStatus
Edit Distance2D string DP — replace / insert / deleteAvailable

More Practice (Coming Soon)

ProblemPatternStatus
Unique Paths IIGrid DP with obstaclesComing Soon
Decode Ways1D linear with conditional transitionsComing Soon
House Robber IILinear DP on a circular arrayComing Soon
Coin Change IIUnbounded knapsack (count of ways)Coming Soon
Distinct SubsequencesLCS variant — count, not lengthComing Soon
Burst BalloonsInterval DPComing Soon
Palindrome Partitioning IIMin cuts via DPComing Soon
Best Time to Buy and Sell Stock IVStock DP with state (day, txn, hold)Coming Soon
Regular Expression Matching2D DP with * and .Coming Soon
Travelling Salesman (Held–Karp)Bitmask DPComing Soon