Basic Dynamic Programming Problems for Coding Interviews
32 basic Dynamic Programming problems from real coding interviews, each with test cases you can run online. By difficulty they split into 32 basic, 0 intermediate and 0 advanced. The companies that ask them most often are Amazon, Google, Meta, Bloomberg.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Climbing Stairs (Basic)
- Fibonacci Number (Basic)
- Is Subsequence (Basic)
- Maximum Ice Cream Bars (Basic)
- Longest Harmonious Subsequence (Basic)
- Minimum Cost to Climb Stairs (Basic)
- Boolean Parenthesization Count (Basic)
- Palindrome Linked List (Basic)
- Number of Ways to Build House Plots (Basic)
- Arranging Coins (Basic)
- Friends Pairing Problem (Basic)
- One Edit Distance (Basic)
- Longest Subsequence With Limited Sum (Basic)
- Build Array From Permutation (Basic)
- Number of Ways to Split Array (Basic)
- Minimum Cost of Buying Candies With Discount (Basic)
- Minimum Cost to Move Chips (Basic)
- Ways to Buy Pens and Pencils (Basic)
- Stair Climbing With Steps One Two or Three (Basic)
- Coin Piles Can Be Emptied (Basic)
- Minimum Cost to Equalize Stick Lengths (Basic)
- Minimum Cost to Make Array a Permutation (Basic)
- FIFO Page Replacement Faults (Basic)
- First-Fit Memory Allocation Count (Basic)
- Sum of Even Fibonacci Numbers Below N (Basic)
- Banknote Breakdown Count (Basic)
- Rounded Cash Payment Total (Basic)
- Greedy Coin Count US (Basic)
- Stair Climbing With Steps One Two Five (Basic)
- Matching Pairs of Handshakes (Basic)
- Distribute With At Least One Each (Basic)
- Two Dice Ways to Roll a Total (Basic)
Related
Frequently asked questions
How do I get good at dynamic programming problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run dynamic programming problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.