AMD interview question

State machine