Skip to main content

Compiler Construction MCQs with Answers

Practice important Compiler Construction MCQs with answers and explanations.

Multiple Choice Questions

Q251: What is the output of the subset construction algorithm?
  • A: A minimized NFA
  • B: A DFA equivalent to the NFA
  • C: A grammar
  • D: A syntax tree
View Answer
B

Q252: In NFA-to-DFA construction, what is ε-closure(T)?
  • A: All states reachable via 'a'
  • B: All final states
  • C: All states reachable from T on ε-transitions
  • D: All unreachable states
View Answer
C

Q253: The function move(T, a) returns
  • A: All NFA states with transitions on a
  • B: All states in DFA
  • C: Only start states
  • D: Final states of DFA
View Answer
A

Q254: In NFA to DFA construction, before reading input, NFA can be in any state of
  • A: move(s0, a)
  • B: ε-closure(s0)
  • C: final states
  • D: DFA start state
View Answer
B

Q255: In the subset construction algorithm, when is a new state added to the DFA?
  • A: When a loop is found
  • B: When the NFA ends
  • C: If the computed state is not in S’
  • D: If it’s a final state
View Answer
C

Q256: The subset construction algorithm uses which data structure for marking states?
  • A: Stack
  • B: Heap
  • C: Queue
  • D: Set
View Answer
D

Q257: What is the first step in subset construction?
  • A: Mark final state
  • B: ε-closure of start state
  • C: Create alphabet
  • D: Minimize DFA
View Answer
B

Q258: The number of possible states in DFA constructed from an NFA with 11 states is up to
  • A: 11
  • B: 22
  • C: 121
  • D: 2048
View Answer
D

Q259: A DFA state is marked as final if it contains
  • A: The start state of NFA
  • B: Any NFA final state
  • C: A loop
  • D: An unreachable state
View Answer
B

Q260: ε-closure({3,8}) = _____________.
  • A: {2,4,6}
  • B: {1,2,3,4,6,7,8}
  • C: {3,8,10}
  • D: {5,6,7}
View Answer
B

Test Your Knowledge

Take a timed quiz on Compiler Construction

🚀 Start Quiz Now