Lifecycle of a Vending Machine
Below is the step-by-step Lifecycle of the Vending Machine:
- The first thing that we want to make sure of is that the vending machine is in the ready state.
- After that, the customer needs to select the item that they want to get and make the required payment for that item, only then will the vending machine dispense the item through a tunnel.
- In case of transaction failure, the system will revert to its ready state. In terms of payment, since this is a cash-only system, it would be beneficial if the vending machine were able to provide change to the customer.
- In addition to this, we can add the cancel button to the vending machine to cancel the transaction.
Vending Machine: High Level System Design
Vending machines which are a common thing to be seen in shopping malls or metro stations, kind of operate by themselves. It’s different from other systems since it is not a distributed system used by millions of people. It is concurrently used by one person at a time and may be used by a few thousand people a day. So we won’t need features like load balancing and caching that we normally use in a system design.
Important Topics for High-Level Design of Vending Machine
- Requirements
- Lifecycle Of A Vending Machine
- Design of Vending Machine
- Follow-Ups
- Scalability