Intel Corporation interview question

build state machine for "CAFFE" case