Loading…
Timed mock · Low-Level Design
45 minutes, split the way the real round is. Answer first, then compare.
The interviewer says
Design the software that runs a vending machine. It has slots labelled A1 through C8, each holding one product at one price with a count. It accepts coins and notes, gives change from whatever it is currently holding, and has a coin return button that works at any point before the product drops. Model the states, the money, and what happens when the machine cannot make change.
Work on paper or in the boxes below. Write your answer first; the guide's version only appears when you ask for it. Nothing you write leaves this browser.