Dynamic Programming interview questions
Practice 7 questions on dynamic programming. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
7 questions
- AlgorithmsCoding exercise
0/1 Knapsack
MEDIUMMaximize the value packed into a weight-limited knapsack when each item can be taken at most once — the classic 0/1 dynamic-programming table.
25 minPractice - AlgorithmsCoding exercise
Edit Distance
MEDIUMCompute the minimum number of insertions, deletions, and replacements to turn one string into another — the Levenshtein distance via a 2D dynamic-programming table.
25 minPractice - AlgorithmsCoding exercise
Maximal Square
MEDIUMFind the area of the largest all-ones square in a binary matrix, where each cell's square size is one more than the smallest of its top, left, and top-left neighbors.
25 minPremium questionPractice - AlgorithmsCoding exercise
Minimum Path Sum
MEDIUMFind the cheapest path from the top-left to the bottom-right of a grid, moving only right or down, by summing each cell with the smaller of the two ways to reach it.
25 minPremium questionPractice - AlgorithmsCoding exercise
Partition Equal Subset Sum
MEDIUMDecide whether an array can split into two subsets with equal sums — a subset-sum dynamic-programming problem over half the total.
25 minPremium questionPractice - AlgorithmsCoding exercise
Segment Words
MEDIUMImplement a function that decides whether a string can be broken into a sequence of words from a given dictionary.
25 minAmazon · Google · Meta +1Practice - AlgorithmsCoding exercise
Wildcard Matching
HARDDecide whether a string matches a pattern containing `?` (any single character) and `*` (any sequence) — a two-dimensional dynamic-programming match over string and pattern.
40 minPremium questionPractice