FastPrepCoin Change
Problems/Coin Change

Coin Change

Accenture logoAccenture● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names a coin-change dynamic programming task but does not say which kind. We use the usual one: find the fewest coins, with unlimited coins of each value. Our version is about 68% the same as the reported question.

You are given an integer array coins containing distinct positive denominations and a nonnegative integer amount.

You may use each denomination any number of times. Return the minimum number of coins needed to make exactly amount. If no combination can make the amount, return -1.

Function

coinChange(coins: int[], amount: int) → int

Examples

Example 1

coins = [1,2,5]amount = 11return = 3

The amount can be formed with 5 + 5 + 1.

Example 2

coins = [2]amount = 3return = -1

No number of 2-value coins can form 3.

Example 3

coins = [2,3,7]amount = 0return = 0

No coins are needed to form amount 0.

Constraints

  • 1 <= coins.length <= 12.
  • 1 <= coins[i] <= 2^31 - 1.
  • All denominations are distinct.
  • 0 <= amount <= 10^4.

More Accenture interview questions

  • Nearest Composite NumberOA · Seen Sep 2026
  • Minimum Password IncrementsOA · Seen Sep 2026
  • Reduce a Number to One DigitOA · Seen Sep 2026
  • Candy DistributionOA · Seen Sep 2026
  • Customers Who Never OrderedOA · Seen Sep 2026
  • Economical TripOA · Seen Sep 2026
  • Validate Email AddressOA · Seen Sep 2026
  • Closest Rhyming WordOA · Seen Aug 2026
  • Array Leader ElementsOA · Seen Nov 2025
  • Alternating Index Square SumONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Card Game: Best First-Player ScoreShopify · OAShopify interview questions
  • Maximum Game Score with Fixed Forward JumpsStripe · OAStripe interview questions
  • 0/1 KnapsackConfluent · OAConfluent interview questions
  • Minimum Cost to Tile a Strip with Widths 1, 2, and 3Infosys · OAInfosys interview questions
  • Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
  • Maximum Subarray SumStraive · OA
  • Longest Increasing Price SubsequenceOpenAI · OAOpenAI interview questions
  • Lowest-Cost Shirt Color ScheduleElevenLabs · OAElevenLabs interview questions
  • Maximum Game Board ScoreJP Morgan Chase · OAJP Morgan Chase interview questions
  • API Bandwidth AllocationArista Networks · OAArista Networks interview questions

Accenture interview experiences

  • Accenture New Grad ASE OA Questions: 15 Experiences
All Accenture interview questionsSee Accenture hiring insights
Saved
class Solution {
    public int coinChange(int[] coins, int amount) {
        // Write your code here.
    }

}
Checking account…