Varonis Systems interview question

Implement generic state machine in pseudo code