FastPrepFewest Coins Combination
Problems/Fewest Coins Combination

Fewest Coins Combination

Bloomberg LP logoBloomberg LP● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Bloomberg asked this in a technical phone screen. There were about five coin values, which the candidate remembered as roughly 1, 5, 10, 15 and 20, with unlimited coins of each. The task was to return the combination that makes a given amount with the fewest coins, not just the number of coins. The candidate solved it with a knapsack-style table that also tracks the best way to make each amount.

The report did not fix the coin values, the output shape, how to break ties between equally short combinations, what to do when the amount cannot be made, or any limits. Here is what we chose. The coin values are an input of 1 to 10 distinct values up to 10^4. The answer is a count per coin value in input order. Among combinations with the fewest coins, the one with the most of the largest value wins, then the next largest, and so on. An amount that cannot be made returns an empty array, and an amount of 0 returns all zeros. Amounts go up to 10^4.

Our version is about 80% the same as the reported question.

You are given an array coins of distinct coin values and an integer amount. You may use any number of coins of each value.

Find a way to make exactly amount with the fewest coins, and return it as an array counts of the same length as coins, where counts[i] is how many coins of value coins[i] you use.

If several ways use the fewest coins, return the one that uses the most coins of the largest value. If that still ties, use the most coins of the second-largest value, and so on.

If amount is 0, every count is 0. If amount cannot be made, return an empty array.

Function

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

Examples

Example 1

coins = [1,5,10,15,20]amount = 3return = [3,0,0,0,0]
  • Only the coin of value 1 is small enough, so the combination is three 1-coins: [3,0,0,0,0].

Example 2

coins = [1,5,10,15,20]amount = 30return = [0,0,1,0,1]
  • The fewest coins is 2, and two combinations reach it: 20 + 10 and 15 + 15.
  • The tie goes to the one with more coins of the largest value, 20, so the answer uses one 20 and one 10: [0,0,1,0,1].

Example 3

coins = [10,4]amount = 7return = []
  • Sums of 4s and 10s are always even, so 7 cannot be made and the answer is an empty array.

Constraints

  • 1 <= coins.length <= 10
  • 1 <= coins[i] <= 104
  • All values in coins are distinct.
  • 0 <= amount <= 104

More Bloomberg LP Phone Screen questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Longest Increasing SubsequenceByteDance · PHONE SCREENByteDance interview questions
  • Jump GamePaytm · PHONE SCREENPaytm interview questions
  • Query Words Within K PositionsPalantir · PHONE SCREENPalantir interview questions
  • House RobberVisa · PHONE SCREENVisa interview questions
  • Best Improvement Period of at Least K IntervalsAmazon · PHONE SCREEN
  • Longest Increasing SubsequenceAngel One · PHONE SCREEN
  • Match Shops and BuyersGoogle · PHONE SCREENGoogle interview questions
  • Maximum Product of a Contiguous SubarrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Minimum-Cost Color SequenceOpenAI · OA · PHONE SCREENOpenAI interview questions

Interview reports that mention this question

  • Bloomberg SWE Phone Screens with Two Teams: 1 Experience

Bloomberg LP interview experiences

  • Bloomberg SWE Phone Screen and Onsite: 1 Experience
  • Bloomberg AI Interview, Hiring Level Not Reported: 2 Experiences
  • Bloomberg Experienced SWE AI Coding Interviews: 2 Experiences
  • Bloomberg New Grad AI-Assisted Coding Rounds: 3 Experiences
  • Bloomberg New Grad SWE AI-Assisted Coding Rounds: 1 Experience
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int[] fewestCoinsCombination(int[] coins, int amount) {
        // Write your code here.
    }
}
Checking account…