pyPython Practice LabFrom first print to final round
TOPIC 13 OF 18

Dynamic Programming and High-Frequency Interviews Python practice problems

Finish with high-frequency dynamic programming, grid, graph-ordering, and sliding-window problems.

20 exercises8+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL PRACTISE

Core concepts

Count ways to climb stairsMaximize nonadjacent house lootFind minimum coinsSolve 0/1 knapsackFind longest increasing subsequence lengthFind longest common subsequence lengthCalculate edit distanceFind longest substring without repeats
REUSABLE THINKING

Problem-solving patterns

  • Define state → recurrence → base cases → evaluation order
INTERVIEW SIGNALS

Reported company tags

AmazonGoogleMicrosoftMeta
Community-reported tags are guidance, not guarantees.
ORDERED PRACTICE

All 20 problems in this topic

Work from top to bottom to build the concept gradually.

  1. #241
    Count ways to climb stairs: Five stairs

    Count different one-step and two-step sequences that reach stair five.

    InterviewPremium
  2. #242
    Count ways to climb stairs: Zero stairs

    There is one way to remain at the starting point: take no steps.

    InterviewPremium
  3. #243
    Maximize nonadjacent house loot: Alternating opportunity

    Find the maximum value without choosing adjacent houses.

    InterviewPremium
  4. #244
    Maximize nonadjacent house loot: Two houses

    Choose the larger value when the only two houses are adjacent.

    InterviewPremium
  5. #245
    Find minimum coins: Reachable amount

    Find the fewest coins needed to make eleven.

    InterviewPremium
  6. #246
    Find minimum coins: Impossible amount

    Return -1 when no combination can form the requested amount.

    InterviewPremium
  7. #247
    Solve 0/1 knapsack: Choose best package

    Maximize value under a small carrying capacity.

    InterviewPremium
  8. #248
    Solve 0/1 knapsack: No item fits

    Return zero when every item is heavier than the capacity.

    InterviewPremium
  9. #249
    Find longest increasing subsequence length: Mixed sequence

    Find the LIS length in a common interview example.

    InterviewPremium
  10. #250
    Find longest increasing subsequence length: Strictly decreasing

    Only one value can belong to a strictly increasing subsequence.

    InterviewPremium
  11. #251
    Find longest common subsequence length: Shared subsequence

    Find the LCS length for two strings with characters in common order.

    InterviewPremium
  12. #252
    Find longest common subsequence length: No common characters

    Return zero when the strings share no character.

    InterviewPremium
  13. #253
    Calculate edit distance: Classic conversion

    Find the minimum edits needed to convert kitten to sitting.

    InterviewPremium
  14. #254
    Calculate edit distance: Empty target

    Deleting every source character is optimal when the target is empty.

    InterviewPremium
  15. #255
    Find longest substring without repeats: Mixed repeats

    Find the longest unique-character window in a common example.

    InterviewPremium
  16. #256
    Find longest substring without repeats: All same character

    A string of identical characters has best window length one.

    InterviewPremium
  17. #257
    Count islands in a grid: Three islands

    Count separate land regions in a small map.

    InterviewPremium
  18. #258
    Count islands in a grid: All water

    Return zero when the grid contains no land.

    InterviewPremium
  19. #259
    Topologically sort tasks: Valid build order

    Produce one valid order for tasks with prerequisites.

    InterviewPremium
  20. #260
    Topologically sort tasks: Cyclic dependencies

    Report Cycle when no complete topological order exists.

    InterviewPremium