Explore topic-wise MCQs in Compilers.

This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following are regular sets?

A. I and IV
B. I and III
C. I and only
D. IVView Answer
Answer» B. I and III
2.

Match the following NFAs with the regular expressions.

A. P-2, Q-1, R-3, S-4
B. P-1, Q-3, R-2, S-4
C. P-1, Q-2, R-3, S-4
D. P-3, Q-2, R-1, S-4View Answer
Answer» D. P-3, Q-2, R-1, S-4View Answer
3.

Which one of the following is FALSE?

A. Every NFA can be converted to DFA
B. Every subset of a recursively enumerable set is recursive
C. All of the mentioned
D. None of the mentioned
Answer» C. All of the mentioned
4.

Which one of the following languages over the alphabet {0,1} is described by the regular expression?

A. String with substring 00
B. String with at most two 0’s
C. String containg at least two 0’s
D. None of the mentionedView Answer
Answer» D. None of the mentionedView Answer
5.

Let w be any string of length n is {0,1}*. Let L be the set of all substring of w. State the minimum number of states in a NDFA that accepts L?

A. n – 1
B. n
C. n + 1
D. 2n – 1
Answer» D. 2n – 1
6.

W hat is the complement of the language accepted by the NFA shown below?

A. A,B
B. B
C. C
D. D,C
Answer» C. C
7.

Given the language L = {ab, aa, baa}, which of the following strings are in L*?

A. 1, 2, 3
B. 2, 3, 4
C. 1, 2, 4
D. 1, 3, 4View Answer
Answer» D. 1, 3, 4View Answer
8.

Choose the correct statement for the following daigram.

A. For the language accepted by A which is also a minimal DFA
B. A accepts all strings over {0,1} of length at least 2
C. All of the mentioned
D. None of the mentioned
Answer» D. None of the mentioned
9.

Consider the languages L1 = and L2 = {a}. Which one of the following represents L1 L2* U L1*?

A.
B. a*
C. All of the mentioned
D. None of the mentioned
Answer» B. a*