Evening Star interview question

Make a state machine based on given parameters