Skip to content

Dynamic Programming problems,
and the tell.

The problem asks for the best, the count, or whether it is possible, and a choice now changes what is left. 314 problems in the catalogue carry this tag, from first-week easy to interview hard.

Free to start. Running and submitting a solution never costs credits.

How the pattern actually works.

One mechanism, and the mistake that costs people the problem.

The tell. The problem asks for the best, the count, or whether it is possible, and a choice now changes what is left.

The mechanism. Write the recursion first: what is the smallest version, and what choice does the current step make? Then stop solving the same call twice, either by remembering answers in a map or by filling a table from the smallest case up.

What goes wrong. A state that does not capture everything the answer depends on. If two different paths reach the same state and need different answers, the state is missing a dimension.

The ones asked most often.

By how often the catalogue records them being set, not by our opinion.

  1. Binary Tree CamerasHardasked at 8 companies
  2. Valid Parenthesis StringMediumasked at 5 companies
  3. Count All Valid Pickup and Delivery OptionsHardasked at 2 companies
  4. Arithmetic Slices II - SubsequenceHardasked at 2 companies
  5. Count Strictly Increasing SubarraysMediumasked at 2 companies
  6. House Robber IVMediumasked at 2 companies
  7. Difference Between Maximum and Minimum Price SumHardasked at 2 companies
  8. Number of Ways to Form a Target String Given a DictionaryHardasked at 2 companies
  9. Construct the Longest New StringMediumasked at 2 companies
  10. Maximize the Number of Partitions After OperationsHardasked at 2 companies

Read it, watch it, then solve it.

The order that makes a pattern stick.

Everything in the app, in one place.

Practice, interviews and the tools, all free to start. Swipe to see the rest.

Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app

About dynamic programming problems.

Free to start, no card.

Start practising
How do I know a problem is a dynamic programming problem?

The problem asks for the best, the count, or whether it is possible, and a choice now changes what is left.

How many dynamic programming problems should I solve?

Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 314, split roughly 9 easy, 106 medium and 85 hard in the sample we show, so work up rather than across.

What goes wrong most often in dynamic programming problems?

A state that does not capture everything the answer depends on. If two different paths reach the same state and need different answers, the state is missing a dimension.

Is practising by pattern better than a problem sheet?

A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.