Search
⌘K

Knapsack Problem Variations

Solve variations of the classic 0/1 knapsack problem, such as when profits are binary (1 or 2) or when weights are fractional (up to 2 decimal places) but items cannot be partially selected. Apply dynamic programming techniques while handling the specific constraints of each variation.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early March, 2026

Google

Google

Senior

Late October, 2024

Google

Google

Mid-level

Solve the knapsack problem when the weights are fractional (up to 2 decimal places) but items cannot be partially selected

Late October, 2024

Google

Google

Mid-level

Solve the knapsack problem when the profit of each item is either 1 or 2

Your account is free and you can post anonymously if you choose.