Collecting Chocolates
A medium-tier problem at 34% community acceptance, tagged with Array, Enumeration. Reported in interviews at Deutsche Bank and 0 others.
Collecting Chocolates is a medium-difficulty array problem with a 33% acceptance rate, asked at Deutsche Bank. Most candidates miss the core insight on first attempt, making it a prime example of where pattern recognition matters. The problem forces you past the greedy intuition into a more creative search space. If you hit this live and blank on the trick, StealthCoder solves it in seconds, invisible to the proctor. The enumeration angle is what catches people off guard.
Companies that ask "Collecting Chocolates"
Collecting Chocolates 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. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoderThe trap here is treating this as a straightforward optimization problem when you actually need to enumerate states or configurations. Greedy doesn't work because local gains conflict with global outcomes. The solution hinges on recognizing that you need to explore multiple starting points or decision sequences to find the maximum. Array manipulation combined with exhaustive but smart enumeration is the pattern. Many candidates timeout by brute-forcing all permutations instead of pruning the search space early. The real trick is understanding when enumeration is the right tool, not sorting or dynamic programming. StealthCoder spots the enumeration pattern instantly when you're staring at the examples.
Pattern tags
You know the problem.
Make sure you actually pass it.
Collecting Chocolates recycles across companies for a reason. It's medium-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. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Collecting Chocolates interview FAQ
Is Collecting Chocolates still actively asked at top companies?+
Yes. Deutsche Bank's reported ask confirms it's in active rotation. Medium difficulty problems with sub-35% acceptance rates tend to stay in interview loops longer because they separate strong coders from average ones. Expect it to appear again.
Why do most people get this wrong on first try?+
Candidates attempt greedy or local optimization first, which fails on the test cases. The problem requires exploring multiple configurations or starting positions, not picking the best option at each step. Once you see that enumeration is necessary, the solution becomes tractable.
Is this really just an array problem or is there a math trick?+
It's array plus enumeration. There's no hidden closed-form math trick. You need to iterate through states, configurations, or sequences intelligently and track the best outcome across all paths. That's the enumeration component.
How much time should I spend on this in a real OA?+
If you don't see the enumeration pattern in 10-12 minutes, step back. Review the examples to spot why greedy fails. The insight usually clicks once you trace through a failing case manually. If it still doesn't, move on and come back with fresh eyes.
What's the connection between 'Array' and 'Enumeration' here?+
The array is your data structure, but enumeration is the algorithmic approach. You iterate through the array from different starting positions or configurations, comparing outcomes across all valid paths, not just one optimal path forward.
Want the actual problem statement? View "Collecting Chocolates" on LeetCode →