Question d’entretien chez Qualcomm

Design a state machine from scratch and show me the code.