Explore topic-wise MCQs in Compilers.

This section includes 10 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 pairs of regular expression are equivalent?

A. 1(01)* and (10)*1
B. X(xx)* and (xx)*x
C. 1(01)* and (10)*1 & X(xx)* and (xx)*x
D. None of the mentioned
Answer» D. None of the mentioned
2.

Which of the following is not regular?

A. String whose length is perfect square and consists of 0s
B. Palindromes consisting of 0’s and 1’s
C. String whose length is perfect square and consists of 0s & Palindromes consisting of 0’s and 1’s
D. None of the mentioned
Answer» D. None of the mentioned
3.

The reorganizing capability of NDFA and DFA is?

A. May be different
B. Must be different
C. Must be same
D. None of the mentioned
Answer» D. None of the mentioned
4.

Which of the following languages is/are regular?

A. L1 and L3 only
B. L2
C. L2 and L3 only
D. L3 onlyView Answer
Answer» B. L2
5.

Consider alphabet ∑ = {0, 1}, the null/empty string λ and the sets of strings X0, X1 and X0. How are X1 and X2 are related? Which one of the following represents the strings in X0?

A. 10 (0* + (10)*)1
B. 10 (0* + (10)*)*1
C. 10 (0* + (10)*)*1
D. 10 (0 + 10)*1 + 110 (0 + 10)*1View Answer
Answer» D. 10 (0 + 10)*1 + 110 (0 + 10)*1View Answer
6.

The number of states in DFA that accepts the language L(M) ∩ L(N) is _________

A. 0
B. 1
C. 2
D. 3
Answer» C. 2
7.

How many minimum states are required to find whether a string has odd number of 0’s or not?

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

What can be said about a regular language L over {a} whose minimal finite state automaton has two states?

A. L must be {an| n is odd}
B. L must be {an| n is even}
C. L must be {an| n is even}
D. Either L must be {an | n is odd}, or L must be {an | n is even}
Answer» E.
9.

Given an arbitrary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent minimized DFA is at least?

A. with N states, the maximum number of states in an equivalent minimized DFA is at least?a) N2
B. 2N
C. 2N
D. N!
Answer» D. N!
10.

L1 is accepted by the NFA, obtained by changing the accepting state of M to a non-accepting state and vice versa. Which of the following statements is true?

A. L1 = {0, 1}* – L
B. L1 = {0, 1}* – L
C. L1 ⊆ L
D. L1=L
Answer» C. L1 ⊆ L