Handshake interview question

Describe a vending machine through code.