Minimum Coin Change
Reported by candidates from MulticoreWare's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
MulticoreWare reported this one in July 2026, and it's the classic minimum coin change. Strip the wording and it's a shortest-path-to-a-target problem on amounts from 0 up to the target, solved with dynamic programming. The report says each denomination is unlimited and you need the fewest coins that hit the amount exactly. It doesn't give constraints or say what to return when the target can't be reached. If you've seen this shape before, it's a ten-minute job. If you blank, StealthCoder is the safety net running invisibly during the live OA, so one frozen minute doesn't sink the attempt.
The problem
Source context: The assessment report specified an unlimited supply of each denomination and asked for the minimum number of coins needed for a target. It did not provide an exact interface, examples, constraints, or unreachable-target convention. Given positive coin denominations coins and a target amount, return the minimum number of coins whose values sum to exactly amount. Each denomination may be used any number of times. Function coinChange(coins: int[], amount: int) → int Examples Example 1 coins = [1,2,5] amount = 11 return = 3 11 = 5 + 5 + 1, so three coins are sufficient, and no two available coins sum to 11.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is to define dp[a] as the fewest coins needed to make amount a. Set dp[0] = 0 and every other entry to infinity. For each amount from 1 to the target, try every coin c where c <= a and take dp[a - c] + 1 if it beats the current value. The answer is dp[amount]. The pitfall is the unreachable case. The report gives no convention, so return -1 when dp[amount] is still infinity, and say so in a comment. Don't use greedy. Largest-coin-first fails on sets like [1,3,4] with target 6, where 3+3 beats 4+1+1. Also handle amount = 0 and skip coins larger than the current amount. Time is O(amount * coins), space is O(amount). If the assessment throws a twist at you and your mind goes empty, StealthCoder reads the screen and hands you a working solution.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Minimum Coin Change cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as coin change. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass MulticoreWare's OA.
MulticoreWare reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Minimum Coin Change FAQ
What's the trick in the MulticoreWare minimum coin change question?+
Bottom-up dynamic programming over amounts. dp[a] holds the fewest coins for amount a, built from dp[a - coin] + 1 across all coins. Start dp[0] at 0 and everything else at infinity. The answer is dp[amount]. It's the unbounded version, so loop amounts in the outer loop or inner loop freely.
Why doesn't greedy work here?+
Taking the largest coin first breaks on non-canonical sets. With coins [1,3,4] and target 6, greedy picks 4+1+1 for three coins, but 3+3 uses two. DP checks every coin at every amount, so it finds the true minimum. Greedy only works for special denomination systems.
What should I return if the amount can't be made?+
The report doesn't specify, so the safe convention is -1, which is the usual choice for this problem. If dp[amount] is still your infinity sentinel at the end, return -1. Add a short comment stating that assumption. Also return 0 when the amount is 0.
How hard is this really?+
It's a medium-level DP and one of the most common ones. The recurrence is short, and the code is about ten lines. Most failures come from the sentinel value, off-by-one loops, or reaching for greedy. If you can write the dp array and the double loop cleanly, you're fine.
How do I prepare in 48 hours?+
Write the bottom-up solution from memory twice, then test it on [1,2,5] with 11, [2] with 3, and amount 0. Learn the O(amount * coins) complexity so you can state it. Then do one related variant, like counting the number of ways, to see how the recurrence changes.