Visteon Interview Question

Write a code for a state machine