Back to problems

Payment State Machine (OA)

Object-Oriented Programming · Stripe · Medium

Build an object-oriented state machine that consumes a stream of payment commands written in a command-line style. The task is delivered in levels, and each new level extends the behavior of the one before it. Every command line carries the same number of arguments. Positions a command does not use are filled with empty-string placeholders, which lets one parser handle every command: Both APPROVE and CAPTURE come with an amount. A candidate recalled the permitted state…

Loading the rest of the question…