Reducing Dishes
A hard-tier problem at 76% community acceptance, tagged with Array, Dynamic Programming, Greedy. Reported in interviews at Sony and 0 others.
Reducing Dishes is a hard DP problem that looks deceptively simple at first. You're given an array of integers representing satisfaction levels, and you need to maximize total satisfaction by selecting a subset and assigning them to time slots. Sony has asked this one. The trap is thinking greedy will work. Most candidates either TLE on a brute-force backtracking solution or lock themselves into a suboptimal greedy choice early. If this lands in your live OA and you hit a wall, StealthCoder solves it in seconds, invisible to the proctor.
Companies that ask "Reducing Dishes"
Reducing Dishes is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoderThe key insight is that sorting the array first unlocks a polynomial DP solution. After sorting, you can use dynamic programming where you decide whether to include each element, and if you do, its contribution grows based on how many previous dishes you've already selected. The multiplication effect of the time index is what trips most people up. The greedy intuition (just pick the highest satisfaction values) fails because satisfaction is multiplied by the order you cook, so sometimes excluding a high value early and including a lower value later yields better total satisfaction. Common pitfall: trying to solve it as a classic knapsack without recognizing the ordering constraint. If you haven't drilled this pattern before and it appears live, StealthCoder surfaces a working DP solution and saves your assessment.
Pattern tags
You know the problem.
Make sure you actually pass it.
Reducing Dishes recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Reducing Dishes interview FAQ
Is this really asking me to try all subsets?+
No. Brute force all subsets hits exponential time. The trick is sorting, then DP. After sorting, you decide to include or exclude each element in sequence. The DP table tracks the maximum satisfaction for each count of dishes selected, which is polynomial.
Why does sorting the array help?+
Sorting lets you build an optimal solution incrementally. If you sort ascending and then consider adding dishes, you can prove that once you decide to include a set of elements, the order they go in is always the same. This structure collapses the search space from exponential to polynomial.
What's the greedy approach and why doesn't it work?+
Greedy says pick the highest satisfaction values first. It fails because satisfaction is multiplied by cook time. Including a lower satisfaction value late might beat excluding it and picking a high value early. The multiplication effect means order matters more than magnitude alone.
How does sorting relate to the DP state?+
After sorting, DP state is (index, count of dishes selected). For each element, you either add it to your current selection (it gets multiplied by the new count) or skip it. This sequential structure is only valid post-sort, which is why sorting is foundational.
Is this still asked at big companies?+
Sony has reported this problem. It's a hard-level DP problem that tests whether you recognize when greedy fails and can pivot to a DP solution. Not as common as standard knapsack, but it shows up in assessments targeting strong candidates.
Want the actual problem statement? View "Reducing Dishes" on LeetCode →