Dynamic Programming
Break a problem into smaller overlapping subproblems, solve each once and reuse the answers. The tell is a question asking for a best, a count or a yes/no over many choices, as in Coin Change. It turns exponential search into polynomial time.
64 problems · 24 with a video · 5 to practice in an AI round
| # | Problem | Difficulty | Video | AI round |
|---|---|---|---|---|
| 1 | Maximum Subarray | Medium | AI round | |
| 2 | Best Time to Buy and Sell Stock | Easy | AI round | |
| 3 | Climbing Stairs | Easy | AI round | |
| 4 | House Robber | Medium | ||
| 5 | Longest Increasing Subsequence | Medium | AI round | |
| 6 | Jump Game | Medium | ||
| 7 | Coin Change | Medium | AI round | |
| 8 | Maximum Product Subarray | Medium | ||
| 9 | Binary Tree Maximum Path Sum | Hard | — | |
| 10 | Unique Paths | Medium | ||
| 11 | Jump Game II | Medium | ||
| 12 | Edit Distance | Medium | ||
| 13 | Best Time to Buy and Sell Stock II | Medium | ||
| 14 | Longest Common Subsequence | Medium | ||
| 15 | Pascal's Triangle | Easy | ||
| 16 | Partition Equal Subset Sum | Medium | — | |
| 17 | Minimum Path Sum | Medium | — | |
| 18 | Longest Valid Parentheses | Hard | — | |
| 19 | Regular Expression Matching | Hard | — | |
| 20 | Decode Ways | Medium | ||
| 21 | Min Cost Climbing Stairs | Easy | ||
| 22 | Counting Bits | Easy | — | |
| 23 | Perfect Squares | Medium | — | |
| 24 | Split Array Largest Sum | Hard | — | |
| 25 | House Robber II | Medium | ||
| 26 | Maximal Square | Medium | ||
| 27 | Unique Binary Search Trees | Medium | — | |
| 28 | Triangle | Medium | ||
| 29 | 01 Matrix | Medium | ||
| 30 | Best Time to Buy and Sell Stock III | Hard | ||
| 31 | Longest Palindromic Subsequence | Medium | — | |
| 32 | Coin Change II | Medium | — | |
| 33 | Best Time to Buy and Sell Stock with Cooldown | Medium | — | |
| 34 | Burst Balloons | Hard | — | |
| 35 | Unique Paths II | Medium | — | |
| 36 | Fibonacci Number | Easy | ||
| 37 | Wildcard Matching | Hard | — | |
| 38 | House Robber III | Medium | ||
| 39 | Interleaving String | Medium | — | |
| 40 | Minimum Cost For Tickets | Medium | — | |
| 41 | Best Time to Buy and Sell Stock IV | Hard | ||
| 42 | Delete and Earn | Medium | — | |
| 43 | Distinct Subsequences | Hard | — | |
| 44 | Valid Parenthesis String | Medium | — | |
| 45 | Number of Longest Increasing Subsequence | Medium | — | |
| 46 | Maximum Profit in Job Scheduling | Hard | — | |
| 47 | Ugly Number II | Medium | — | |
| 48 | Predict the Winner | Medium | — | |
| 49 | Russian Doll Envelopes | Hard | — | |
| 50 | Dungeon Game | Hard | — | |
| 51 | Frog Jump | Hard | — | |
| 52 | Palindrome Partitioning II | Hard | — | |
| 53 | Binary Tree Cameras | Hard | — | |
| 54 | Integer Break | Medium | — | |
| 55 | Partition Array for Maximum Sum | Medium | — | |
| 56 | Minimum Cost to Cut a Stick | Hard | — | |
| 57 | Minimum Number of Refueling Stops | Hard | — | |
| 58 | Cherry Pickup | Hard | — | |
| 59 | Paint House | Medium | — | |
| 60 | Number of Digit One | Very hard | — | |
| 61 | Non-negative Integers without Consecutive Ones | Very hard | — | |
| 62 | Paint Fence | Medium | — | |
| 63 | Maximum Vacation Days | Hard | — | |
| 64 | Count the Number of Inversions | Very hard | — |
Sort by what interviews ask
Sign in to see how many companies ask each problem, sort all 500 by it or by likes, and tick off what you solve.
Practice in an AI round
Five of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.
Practice Maximum Subarray in an AI roundYour first AI round is free.