Thoughtworks interview question

A knapsack problem