Analog Devices interview question

State diagram, cmos logic gates