MathWorks interview question

Questions from Finite automata