Coin Change
A medium-tier problem at 46% community acceptance, tagged with Array, Dynamic Programming, Breadth-First Search. Reported in interviews at Datadog and 36 others.
Coin Change shows up in live assessments at Amazon, PayPal, Mastercard, and Walmart Labs regularly. You get an array of coin denominations and a target amount. Find the minimum number of coins needed to make that amount, or return -1 if it's impossible. The acceptance rate sits at 46%, which means nearly half the candidates who attempt it fail or time out. The trap is thinking greedy works here. It doesn't. If this problem hits your assessment and you freeze on the DP recurrence, StealthCoder solves it invisibly in seconds.
Companies that ask "Coin Change"
Coin Change 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 Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderThe intuition most candidates try first is greedy: always take the largest coin. But test it: coins=[3,4], amount=6. Greedy grabs two 3s. Optimal is one 3 and one 4. The real solution lives in dynamic programming. Build a table where dp[i] is the fewest coins needed to make amount i. For each amount from 1 to your target, try subtracting each coin and take the minimum. Time is O(amount * coin_count), space is O(amount). BFS also works: treat each amount as a node, each coin subtraction as an edge, and search for the target. Most candidates get the DP logic right but botch base cases or off-by-one errors in the loop. StealthCoder hedges the moment you can't reconstruct the recurrence on the fly.
Pattern tags
You know the problem.
Make sure you actually pass it.
Coin Change 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. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Coin Change interview FAQ
Is Coin Change still asked at FAANG companies?+
Yes, consistently. Amazon, PayPal, and Mastercard report asking it. At 46% acceptance, it's hard enough to separate candidates but not so obscure that you can't prep it. It's a core DP problem that filters for algorithmic thinking, not memorization.
What's the trick that makes candidates fail?+
Assuming a greedy approach works. Many try 'always pick the largest coin' and get stuck when it produces a suboptimal result. The real trick is realizing you need to explore all coins at each step, not just one, and track the minimum. DP or BFS both enforce this.
DP or BFS? Which is faster?+
DP is cleaner and more predictable: O(amount * num_coins) time, O(amount) space. BFS can be faster in practice if the answer is small, because you stop early, but has worse worst-case complexity. DP is the safer bet in an interview.
How do I handle the base case?+
Set dp[0] = 0 (zero coins needed for amount zero). Initialize all other dp[i] to infinity or a sentinel value like amount+1. Then for each amount, only update if dp[amount - coin] was reachable. This prevents false negatives when the answer is -1.
What if coins are really large or the amount is huge?+
If amount is in the millions, DP will time out or run out of memory. That's a constraint issue, not a logic issue. In a real assessment, the problem statement caps both. Ask your interviewer if there are hidden constraints, but assume the straightforward DP approach is intended.
Want the actual problem statement? View "Coin Change" on LeetCode →