X-Team interview question

The Coin exchange code problem