Moody's Interview Question

Coin selection puzzle, SQL Joins