← Goldman Sachs questions
CodingMediumReported in a candidate post, Jul 2025

Classic 0-1 knapsack

Filed under Goldman Sachs

Classic 0-1 knapsack: given n items with weights and values and a bag of capacity W, choose a subset of items, each at most once, to maximise total value without exceeding W. Return the maximum value.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.