NVIDIA interview question

Design a state machine for a traffic intersection.