Data Structures & AlgorithmsHardTCS NQT · Product Company SDE

Problem: In how many ways can 100 be made using coins 1, 5, 10, 25 (order does not matter)?

  1. A. 292
  2. B. 29
  3. C. 242
  4. D. 213

Correct answer: C. 242

The coin-change DP over coins in outer order gives 242 combinations. Adding a 50-cent coin gives 292, dropping the 1-cent coin gives 29, and making 99 instead of 100 gives 213.

More Coding Interview Problems questions

Exams that ask this topic