Pergunta de entrevista da empresa IntriCon

How would you write a state machine?