Compile Ready
DSA
DSA/Dynamic Programming

Dynamic Programming

This is a premium interview-preparation course built around one goal: teaching you to **recognise** a DP problem the moment you see it, derive its state, and write the recurrence — then implement a clean, bottom-up Java 17 solution. You will start with the mental model (overlapping subproblems, optimal substructure, memoization vs tabulation) and then work through curated problems grouped by the patterns interviewers actually test: 1D, grid, sequence, knapsack, decision, string, and advanced interval / game DP.

41

Curated lessons

8

Learning modules

14h 39m

Est. study time

9

Target companies

What you'll learn

  • Recognise the tell-tale signs of a DP problem: choices, overlapping subproblems, and optimal substructure.
  • Derive the state definition and state transition (recurrence) systematically from a recursive formulation.
  • Convert top-down memoization into bottom-up tabulation and then into space-optimized DP.
  • Communicate your approach the way senior and staff interviewers expect: state, transition, complexity.

Your progress

0%

0 / 41

problems completed

41 available now · keep going!

Mark lessons complete as you work through them. Progress is saved on this device and syncs to your account when you sign in.

Learning roadmap

Work top to bottom — each module builds on the last.

  1. 1

    Dynamic Programming Fundamentals

    Identify state, transition, and base cases

    The mental model: spot overlapping subproblems and optimal substructure, then choose memoization or tabulation.

    11/11 problems1h 28m
  2. 2

    1D Dynamic Programming

    dp[i] from dp[i-1], dp[i-2] …

    A single array of state where each cell depends on a constant number of previous cells — the gateway pattern.

    6/6 problems1h 51m
  3. 3

    Grid Dynamic Programming

    dp[i][j] from dp[i-1][j], dp[i][j-1]

    Two-dimensional state over a grid where each cell is reached from its top and left neighbours.

    5/5 problems1h 50m
  4. 4

    Sequence Dynamic Programming

    dp[i][j] over two sequence indices

    State indexed by positions in one or two sequences — subsequences, alignment, and edit operations.

    4/4 problems2h
  5. 5

    Knapsack Pattern

    dp[capacity] over items, choose or skip

    Choose or skip each item to hit a target capacity — the 0/1 and unbounded knapsack family.

    5/5 problems2h 16m
  6. 6

    Decision Dynamic Programming

    dp[i] = OR / min over valid cuts j < i

    Partition a value or string into pieces, where each cut is a decision validated against a set.

    3/3 problems1h
  7. 7

    String Dynamic Programming

    dp over substring ranges / index pairs

    Count or match over substrings, where state spans a range or a pair of positions in the strings.

    3/3 problems1h 19m
  8. 8

    Advanced Dynamic Programming

    Interval DP, game DP, k-dimensional state

    Interval DP, game theory, and multi-dimensional state — the hardest patterns interviewers reach for.

    4/4 problems2h 55m

Modules

8 themed modules from fundamentals to advanced.

Full curriculum

30 problems and 11 concept lessons in learning order.

Techniques you'll master

0/1 Knapsack1D DP2D DP3D DPArrayArraysBase CasesBinary SearchBottom-UpBottom-Up DPCircular ArrayCombinationsCombinatoricsCorrectnessCountingDecision DPDynamic ProgrammingFibonacciFoundationsGame TheoryGrid DPHash SetInitializationInterval DPInterview FrameworkJavaLCSMathMatrixMaximisationMemoizationMinimaxMinimizationMinimum CountMulti-Agent DPObstaclesPalindromePartitionPartition DPPatience SortingPatternsPrefix DPRecurrenceRecursionRecursion TreesReverse DPRolling ArraySequence DPShortest PathSpace OptimizationState DesignState MachineStock TradingStringString DPStringsSubsequenceSubset SumTabulationTop-DownTrade-offsTransaction DPTransitionsTriangle DPTwo CapacitiesTwo PointersUnbounded Knapsack