FastPrepCoin Change
Problems/Coin Change

Coin Change

Omnissa logoOmnissa● MediumONSITE INTERVIEW
QuestionFunctionExamples

Problem statement

A quick note: this problem is backed by a real Omnissa onsite interview report that directly named Coin Change. The report did not include an exact function interface, examples, constraints, or impossible-case return value. The core task match is about 90%.

You are given coin denominations and a target amount. Return the fewest number of coins needed to make exactly that amount.

You may use each coin denomination any number of times. If the amount cannot be made, return -1.

Interview Follow-up

The candidate walked through brute-force, improved, and 1D dynamic-programming approaches. The interviewer expected working, compilable code in a language of the candidate's choice.

Function

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

Examples

Example 1

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

11 = 5 + 5 + 1, so the minimum number of coins is 3.

Example 2

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

No combination of coin 2 can make amount 3.

More Omnissa problems

  • Build and Check a Palindrome Linked ListONSITE INTERVIEW · Seen Sep 2026
  • Find the CelebrityONSITE INTERVIEW · Seen Sep 2026
  • Maximum All-Ones Square Side LengthONSITE INTERVIEW · Seen Sep 2026
All Omnissa interview questionsSee Omnissa hiring insights
Saved
public int coinChange(int[] coins, int amount) {
  // write your code here
}
Checking account…