Topic
Dynamic Programming interview problems
States, transitions and memoization on sequences and grids. 137 original problems, each with hidden test cases you can run in the browser.
5 easy96 medium36 hard
Showing 91–120 of 137 results
Tests the 2-constraint (weight + volume) knapsack variant using DP with memoization or tabulation to maximize the total utility of selected gear items.
Auto-gradeddynamic programmingknapsackmemoizationTests budgeted 0/1 selection with a bottleneck objective, requiring Pareto-frontier pruning over a four-dimensional knapsack state space.
Auto-gradedknapsackpareto-frontierbottleneckcombinatorial-optimizationFor each prefix of a string, find the maximum number of contiguous blocks it can be split into where every character in a block shares the same frequency.
Model answerdynamic programmingstringsfrequency countingprefix processingTests capacity-constrained subset selection with multi-level tie-breaking: fewest venues, then minimum total capacity, then lexicographically smallest ID list.
Auto-gradeddynamic-programmingsubset-sumcombinatoricsTests DP over prime-length jumps on an array and binary search on a "maximize the minimum" pipeline scaling problem, combined into one function.
Auto-gradeddynamic-programmingbinary-searchnumber-theoryTests dynamic programming optimization using binary search to efficiently compute the longest strictly increasing subsequence in O(n log n) time.
Auto-gradedbinary-searchsubsequencesgreedyTests dynamic programming reasoning on sequential digit-to-letter mappings, including careful handling of zeros and invalid two-digit pairs.
Auto-gradeddynamic-programmingstringsrecursionTests dynamic programming by finding the optimal way to partition a rod into segments to maximize total selling price.
Auto-gradeddynamic-programmingoptimizationunbounded-knapsackImplement a weight-capacity optimizer returning max value and an exact item set, using O(W) space DP, then extend to unbounded and bounded variants.
Model answerdynamic-programmingknapsackreconstructionoptimizationDesign a physics-based agent that decides when to jump by projecting future trajectories and checking collision-free paths through upcoming obstacles.
Model answergame-physicssimulationtrajectory-planningTests whether a candidate can model a pick/skip DP with a "no two consecutive skips" constraint using O(1) space and O(n) time.
Auto-gradeddynamic-programmingarraysgreedyTests dynamic programming with state tracking to count subsequences where consecutive elements alternate between even and odd values.
Auto-gradeddynamic-programmingsubsequencesparitymodular-arithmeticTests understanding of 0/1 knapsack disguised by a misleading ordering constraint that is actually always satisfiable.
Auto-gradedknapsackdynamic-programminggreedyTests the classic bounded knapsack variant where you must determine the minimum number of identical bins needed so each bin's total weight stays within a capacity, using DP to check feasibility.
Auto-gradeddynamic programmingknapsackmemoizationTests dynamic programming over value buckets with a two-pointer prefix-sum transition to count sorted integer sequences under a digit-sum constraint.
Auto-gradeddynamic-programmingarraysmath-bitsTests unbounded-knapsack DP by counting unordered multisets of tile widths, drawn from a given list, that sum exactly to a target corridor length.
Auto-gradeddynamic-programmingcombinatoricsunbounded-knapsackTests string parsing, memoized backtracking, and combinatorial enumeration by decoding a symbol-encoded message with either explicit or missing letter boundaries.
Auto-gradedstringsdynamic-programmingbacktrackingTests whether a candidate can apply forward-reachability DP with a trie to decide if a string can be fully covered by vocabulary words end-to-end.
Auto-gradeddynamic-programmingstringstrieDelete the fewest bracket characters to make all remaining brackets properly matched and nested, keeping all non-bracket characters intact.
Model answerdynamic-programmingstringsinterval-dpTests dynamic programming with Trie optimization to determine if a string can be fully decomposed into a sequence of dictionary words.
Auto-gradedtriestring-processingmemoizationTests probability reasoning with independent random events and dynamic programming for combinatorial counting with unlimited resources.
Auto-gradedprobabilityexpected-valuecombinatoricsunbounded-knapsackTests interval dynamic programming by finding the least expensive way to parenthesize consecutive matrix multiplications.
Auto-gradedinterval-dpoptimizationmemoizationTests interval dynamic programming to build fully parenthesized expressions using all numbers in order with +, -, * operators to reach a target value.
Auto-gradeddynamic-programmingrecursionstringsTests dynamic programming on a grid with diagonal moves, tracking reachable states column-by-column while enforcing waypoint visitation order.
Auto-gradedgriddpspace-optimizationTests dynamic programming and greedy strategies to compute optimal profit from array-based buy/sell scheduling with transaction limits.
Auto-gradedarraysgreedystate-machineoptimizationTests dynamic programming with state tracking to maximize earnings from daily pay and streak bonuses while converting limited off-days to work-days.
Auto-gradeddynamic-programmingstate-machineoptimizationTests string manipulation and dynamic programming through reversing text and finding optimal contiguous subarrays by sum and product.
Auto-gradedarraysstringskadanesubarrayTests the candidate's ability to apply a 2D knapsack variant requiring exactly a fixed item count while maximizing value, combining count and capacity constraints via DP.
Auto-gradeddynamic programmingknapsack2d dpTests subset enumeration with bitmask DP, binary expression tree generation, operator application with exact rational arithmetic, and combinatorial search.
Auto-gradedbitmask-dprecursioncombinatoricsTests dynamic programming with state transitions to find optimal profit from up to two non-overlapping buy-sell trades given daily stock prices.
Auto-gradedarraysstate-machineoptimization