System design interview question
Design State Machine Framework
A generic StateMachine<S, E> framework: declarative transition table (current state + event → next state + action), guards for conditional transitions, entry/exit actions per state, history (shallow and deep), and hierarchical states / statecharts. Implemented in TypeScript, Java, and C++ with tests covering an order workflow.
Practice this question step by step with an AI interviewer that reviews your requirements, your architecture and your trade-offs, and scores the design.