SEP interview question

cracker barrel game solving question.