Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Coin Change

Python data engineering interview problem. Difficulty: advanced. Pattern: Dynamic Programming. About 18 minutes. Part of the Pro drill bank.

Fewest coins to make amount; -1 if impossible. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Implement coin_change(coins: list, amount: int) -> int. (5+5+1).

Constraints

  • Return -1 if amount cannot be made.
  • coins are positive integers.

Examples

Input: coin_change([1, 2, 5], 11) Output: 3 5+5+1.

Topics: lakebench, python, dp, unbounded knapsack.

More Python interview questions · All interview problems · Learn data engineering

advanced

Coin Change

Interview-style drill: Fewest coins to make amount; -1 if impossible.

Implement `coin_change(coins: list, amount: int) -> int`. Example: `[1, 2, 5], 11` → `3` (5+5+1). Keep the harness.