Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q271: DFA is ___________ automaton.
- A: Non-deterministic
- B: Multi-tape
- C: Deterministic
- D: Ambiguous
View Answer
C
Q272: Which is used to track unprocessed states in subset construction?
- A: Stack
- B: Queue
- C: Unmarked set list
- D: Priority queue
View Answer
C
Q273: Which part of the NFA contributes to ε-closure?
- A: Direct transitions
- B: Epsilon transitions
- C: Final state transitions
- D: All transitions
View Answer
B
Q274: The DFA transition function in subset construction is represented as
- A: S’ x Σ → Σ
- B: S x Σ → S
- C: S’ x Σ → S’
- D: Σ x Σ → S’
View Answer
C
Q275: What is the purpose of DFA minimization?
- A: To add more states
- B: To remove transitions
- C: To reduce number of states
- D: To remove alphabets
View Answer
C
Q276: Which algorithm is commonly used to minimize DFA states?
- A: Knuth-Morris algorithm
- B: Huffman’s algorithm
- C: Hopcroft’s algorithm
- D: Dijkstra’s algorithm
View Answer
C
Q277: In DFA minimization, states A and C can be merged if they are
- A: Accepting states
- B: Equivalent states
- C: Final states
- D: Initial states
View Answer
B
Q278: In a minimized DFA, what does each state represent?
- A: An input symbol
- B: A unique transition
- C: A group of equivalent states
- D: A start symbol
View Answer
C
Q279: What is the output of a lexical analyzer?
- A: Tokens or error
- B: Bytecode
- C: Parse tree
- D: Abstract syntax tree
View Answer
A
Q280: What does a lexical analyzer use to identify tokens?
- A: Grammar rules
- B: Regular expressions
- C: Syntax tree
- D: Parsing table
View Answer
B