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)?
- A. 292
- B. 29
- C. 242
- 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
- Problem: How many binary strings of length 5 contain no three consecutive 1s?
- Problem: Stock trading allows unlimited transactions, but after selling you must wait one day before buying (cooldown). Prices are [1, 2…
- Problem: Josephus with step 3: 10 people numbered 1 to 10 stand in a circle. Starting from person 1, count 3 people and eliminate the…
- Problem: The sequence x0 = 1 and x(n+1) = (3·x(n) + 1) mod 7 is generated. The first repeated value appears at some step. What is the…
- Problem: A ball starts at position 0 on a track from 0 to 10 and moves 3 units per second. At each boundary it reverses direction…
- Problem: The permutation [2, 1, 4, 3] is processed by a single stack: input elements are pushed in order and popped whenever the popped…