Module 10 · System Design · Six more low-level rounds
Design a vending machine (states that refuse)
Design a Vending Machine · Open board
The four states and the buttons each refuses, money in whole paise, the change that greedy cannot make, and the operator mid-sale.
Before you start. You need two lessons. Tell everyone who cares (Observer and State) taught the state pattern: an object hands every action to a small class standing for the situation it is in right now, and that class either does the action and swaps in the next situation, or refuses with an error. A missing arrow in the drawing is a refused action. Design a parking lot (the first whole round) ran a whole interview round in order: ask questions, find the entities, sketch the classes, code the one tricky part, take the follow-up. This lesson runs the same round on a machine whose whole personality is saying no.
Lesson 46 of 73 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.