Epic Interview Question

How would you program a machine that returns change? What about if the coin values were arbitrary?