GATE 2025 CS (CS1) – Question 50
Consider the following deterministic finite automaton (DFA) defined over the alphabet, $\Sigma = \{a,b\}$. Identify which of the following language(s) is/are accepted by the given DFA.

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) The set of all strings ending with the pattern $bab$.
Explanation
The states track the longest suffix matching a prefix of 'bab': q0 = none, q1 = b, q2 = ba, q3 = bab. The accepting state q3 has outgoing transitions (a→q2, b→q1), so it is not absorbing. The DFA accepts exactly the strings ending in bab.