Subset Sum Problem

Updated Apr 28, 2026

Short answer

Checking if there is a subset of the given set with sum equal to a given value.

Deep explanation

Mid-level DP involves identifying the transition recurrence and the dimensions of the DP table. Checking if there is a subset of the given set with sum equal to a given value.

Real-world example

Optimizing cargo loading on a ship with weight limits.

Common mistakes

  • Confusing 0/1 Knapsack (cannot split items) with Fractional Knapsack (Greedy).

Follow-up questions

  • How can you optimize space in 0/1 Knapsack?

More Dynamic Programming interview questions

View all →