Explore topic-wise InterviewSolutions in .

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

1.

State true or false:Statement: Regular expression can directly be converted to DFA without intermediate steps.(a) Statement: Regular expression can directly be converted to DFA without intermediate steps.(b) true(c) falseThis question was addressed to me in a national level competition.The doubt is from Conversions among Representations in portion Properties of Regular Languages of Automata Theory

Answer»

Right ANSWER is (B) true

Easy explanation: There exists SUBSEQUENT steps like formation of epsilon-NFA and NFA before the formation of corresponding DFA.

2.

Which of the following is a function of Closure properties?(a) Helps construct representations(b) Helps show informally described languages not to be in class(c) Both (a) and (b)(d) None of the mentionedI have been asked this question in examination.The question is from Testing Emptiness and Membership topic in portion Properties of Regular Languages of Automata Theory

Answer»

Right answer is (c) Both (a) and (b)

EXPLANATION: Using closure properties we can give a=solution to MANY problems like :

Is the regular languages L1 and L2 closed on CONCATENATION operation?, ETC.

3.

Which of the following are not meant to specify a regular language?(a) Regular Expression(b) DFA(c) NDFA and epsilon-NFA(d) All of the mentionedThe question was asked in class test.I need to ask this question from Testing Emptiness and Membership in division Properties of Regular Languages of Automata Theory

Answer»

The correct option is (d) All of the mentioned

Explanation: It is possible to CONVERT from one specification to ANOTHER. We can EXPRESS a regular LANGUAGE in all the GIVEN four variants.

4.

Which of the following are decision properties?(a) Emptiness(b) Infiniteness(c) Membership(d) All of the mentionedThe question was posed to me in my homework.My doubt is from Testing Emptiness and Membership in division Properties of Regular Languages of Automata Theory

Answer»

Right answer is (d) All of the mentioned

For explanation: Emptiness, Infiniteness and Membership are the decision PROPERTIES of any language CLASS. Example: Is the language L empty? Or Is w, a string belongs to the REGULAR language L?

5.

Language classes have the following property:(a) Closure property(b) Decision property(c) Closure & Decision property(d) None of the mentionedI got this question in an international level competition.Asked question is from Testing Emptiness and Membership in division Properties of Regular Languages of Automata Theory

Answer» RIGHT answer is (C) CLOSURE & Decision property

For explanation: A decision property of a language class is an algorithm that takes a formal description of a language(e.g., a DFA) and tells whether or not some property HOLDS.
6.

Which of the following problems do not belong to decision properties?(a) Given two languages, are there strings that are in both(b) Is the language a subset of another regular language(c) Is the language same as another regular language(d) None of the mentionedI had been asked this question by my college director while I was bunking the class.Query is from Testing Emptiness and Membership topic in section Properties of Regular Languages of Automata Theory

Answer»

Correct choice is (d) None of the mentioned

Best explanation: To GIVE a solution to the mentioned problems, we require decision properties and for some, we need ADDITIONAL tools LIKE minimized automaton and Pumping lemma.

7.

Pick the odd one out of the given properties of a regular language:(a) Kleene(b) Reversal(c) Homomorphism(d) MembershipI had been asked this question in class test.My enquiry is from Testing Emptiness and Membership topic in division Properties of Regular Languages of Automata Theory

Answer»

The correct answer is (d) Membership

Explanation: Membership is a decision property of language class while OTHERS MENTIONED LIKE Kleene, Reversal and HOMOMORPHISM are Closure PROPERTIES of language class.

8.

If L1′ and L2′ are regular languages, then L1.L2 will be(a) regular(b) non regular(c) may be regular(d) none of the mentionedThe question was asked during an interview.I would like to ask this question from Closure Properties under Boolean Operations topic in portion Properties of Regular Languages of Automata Theory

Answer» CORRECT option is (a) REGULAR

The explanation: Regular language is CLOSED under complement OPERATION. Thus, if L1′ and L2′ are regular so are L1 and L2. And if L1 and L2 are regular so is L1.L2.
9.

The language of balanced paranthesis is(a) regular(b) non regular(c) may be regular(d) none of the mentionedThe question was posed to me in examination.The above asked question is from Applications of Pumping Lemma/Pigeonhole principle topic in portion Properties of Regular Languages of Automata Theory

Answer» CORRECT option is (B) NON regular

For explanation I would say: Given n, there is a string of balanced parentheses that begins with more than p LEFT parentheses, so that y will contain entirely of left parentheses. By repeating y, we can produce a string that does not contain the same number of left and right parentheses, and so they cannot be balanced.
10.

Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of repeating y 0 or more times before checking that they still belong to the language L or not?(a) Generating(b) Pumping(c) Producing(d) None of the mentionedI had been asked this question in a job interview.This interesting question is from Pumping Lemma for Regular Language in division Properties of Regular Languages of Automata Theory

Answer»

Correct ANSWER is (b) PUMPING

The EXPLANATION is: The PROCESS of repeatation is CALLED pumping and so, pumping is the process we perform before we check whether the pumped string belongs to L or not.

11.

If L is a regular language, then (L’)’ U L will be :(a) L(b) L’(c) f(d) none of the mentionedI had been asked this question during a job interview.The above asked question is from Closure Properties under Boolean Operations topic in section Properties of Regular Languages of Automata Theory

Answer»

The CORRECT option is (a) L

Explanation: (L’)’ is equivalent to L and L U L is SUBSEQUENTLY equivalent to L.

12.

NFA to DFA conversion is done via(a) Subset Construction method(b) Warshalls Algorithm(c) Ardens theorem(d) None of the mentionedThe question was posed to me by my college professor while I was bunking the class.The doubt is from Conversions among Representations in section Properties of Regular Languages of Automata Theory

Answer»

Correct answer is (a) Subset CONSTRUCTION method

The EXPLANATION is: Powerset or subset construction method is a standard method for converting a non deterministic finite automata into DFA which recognizes the same FORMAL language.

13.

Which of the following is/are an example of pigeon hole principle?(a) Softball team(b) Sock picking(c) Hair counting(d) All of the mentionedI had been asked this question in unit test.I'm obligated to ask this question of Applications of Pumping Lemma/Pigeonhole principle in chapter Properties of Regular Languages of Automata Theory

Answer»

The correct answer is (d) All of the mentioned

Best EXPLANATION: There are several applications of pigeonhole principle:

Example: The SOFTBALL team: Suppose 7 people who want to play softball(n=7 items), with a limitation of only 4 softball teams to choose from. The pigeonhole principle tells US that they cannot all play for different teams; there must be atleast one team featuring atleast two of the seven players.

14.

Conversion of regular expression to e-NFA takes ___________ time.(a) linear(b) exponential(c) logarithmic(d) none of the mentionedI got this question in my homework.This intriguing question originated from Conversions among Representations topic in division Properties of Regular Languages of Automata Theory

Answer»

Right choice is (a) linear

Explanation: It is possible to parse the expression efficiently, using a technique that TAKES only O(N) TIME on a expression of LENGTH n^3.

15.

Which of the following is not an application of Pumping Lemma?(a) {0^i1^i|i>=0}(b) {0^ix|i>=0, x∈{0, 1}* and |x|

Answer» RIGHT option is (d) NONE of the mentioned

To elaborate: None of the mentioned are REGULAR language and are an application to the TECHNIQUE Pumping Lemma. Each one of the mentioned can be proved non regular using the steps in Pumping lemma.
16.

While proving Inverse Homomorphism, which of the following steps are needed?(a) Start with a DFA Ain L(b) Construct a DFA B for h-1(L)(c) The set of states, initial and final states should be same.(d) All of the mentionedThis question was posed to me during an online exam.The question is from Reversal-Homomorphism and Inverse Homomorphism topic in section Properties of Regular Languages of Automata Theory

Answer»

The correct choice is (d) All of the mentioned

Explanation: While constructing DFA B, we NEED to take care of the following:

a) The same SET of states

b) The same START state

c) The same final state

d) INPUT alphabet = the symbols to which HOMOMORPHISM h applies.

17.

The computation of e-closure of n-states takes ______ time.(a) O(n^2)(b) O(n^3)(c) O(2^n)(d) None of the mentionedThis question was posed to me in an interview.My question comes from Conversions among Representations topic in chapter Properties of Regular Languages of Automata Theory

Answer» RIGHT answer is (b) O(n^3)

Best explanation: We MUST SEARCH from each of the n states along all arcs LABELLED e. If there are n states, there can be no more than n^2 states.
18.

While applying Pumping lemma over a language, we consider a string w that belong to L and fragment it into _________ parts.(a) 2(b) 5(c) 3(d) 6I got this question in examination.The above asked question is from Pumping Lemma for Regular Language topic in chapter Properties of Regular Languages of Automata Theory

Answer»

The CORRECT CHOICE is (C) 3

Easiest explanation: We select a STRING w such that w=xyz and |y|>0 and other conditions. However, there exists an integer n such that |w|>=n for any wÎL.

19.

State true or false:Statement: Pumping lemma gives a necessary but not sufficient condition for a language to be regular.(a) Statement: Pumping lemma gives a necessary but not sufficient condition for a language to be regular.(b) true(c) falseI got this question in exam.I need to ask this question from Applications of Pumping Lemma/Pigeonhole principle in chapter Properties of Regular Languages of Automata Theory

Answer» CORRECT answer is (a) Statement: PUMPING lemma gives a necessary but not SUFFICIENT CONDITION for a language to be regular.

To explain: The converse of the lemma is not true. There may EXISTS some language which satisfy all the conditions of the lemma and still be non-regular.
20.

If we select a string w such that w∈L, and w=xyz. Which of the following portions cannot be an empty string?(a) x(b) y(c) z(d) all of the mentionedThe question was posed to me in my homework.I need to ask this question from Pumping Lemma for Regular Language in division Properties of Regular Languages of Automata Theory

Answer» RIGHT ANSWER is (b) y

Explanation: The LEMMA says, the portion y in xyz cannot be zero or empty i.e. |y|>0, this condition needs to be FULFILLED to CHECK the conclusion condition.
21.

Which kind of proof is used to prove the regularity of a language?(a) Proof by contradiction(b) Direct proof(c) Proof by induction(d) None of the mentionedThis question was posed to me in an internship interview.Origin of the question is Applications of Pumping Lemma/Pigeonhole principle in section Properties of Regular Languages of Automata Theory

Answer»

Correct OPTION is (a) PROOF by contradiction

For explanation: We use the method of proof by contradiction in pumping lemma to PROVE that a LANGUAGE is REGULAR or not.

22.

Which of the following conversion is not feasible?(a) Regular expression to automaton conversion(b) Automaton to Regular Expression Conversion(c) NFA to DFA(d) None of the mentionedI had been asked this question in an internship interview.The doubt is from Conversions among Representations topic in chapter Properties of Regular Languages of Automata Theory

Answer» RIGHT option is (d) None of the mentioned

Best explanation: Each of the four FORMATS of representation of the REGULAR language be it, DFA, NFA, Regular Expression or e-NFA can be converted to the rest three forms.
23.

If L is a regular language, ____ is also regular.(a) L^r(b) L’(c) L*(d) All of the mentionedThe question was posed to me by my college director while I was bunking the class.This intriguing question originated from Reversal-Homomorphism and Inverse Homomorphism topic in division Properties of Regular Languages of Automata Theory

Answer»

Right answer is (d) All of the mentioned

The EXPLANATION: L^r, L’, L* i.e. REVERSAL, complementation and kleene all are the CLOSURE properties of REGULAR language.

24.

If L1, L2 are regular and op(L1, L2) is also regular, then L1 and L2 are said to be ____________ under an operation op.(a) open(b) closed(c) decidable(d) none of the mentionedThis question was addressed to me during an interview.My doubt is from Closure Properties under Boolean Operations in division Properties of Regular Languages of Automata Theory

Answer»

The correct answer is (b) CLOSED

For EXPLANATION I would SAY: If two regular languages are closed under an operation OP, then the resultant of the languages over an operation op will ALSO be regular.

25.

Which of the following can refer a language to be non regular?(a) Pumping Lemma(b) Myphill Nerode(c) Both (a) and (b)(d) None of the mentionedThe question was asked in an online quiz.Question is from Applications of Pumping Lemma/Pigeonhole principle topic in division Properties of Regular Languages of Automata Theory

Answer»

The correct option is (c) Both (a) and (b)

EASY explanation: On the contrary, the typical way to PROVE that a language is to CONSTRUCT either a finite STATE machine or a regular expression for the language.

26.

For a _________ state DFA, the time taken for DFA-NFA conversion is O(n).(a) n(b) n^1/2(c) n^2(d) 2^nI got this question by my school teacher while I was bunking the class.Question is from Conversions among Representations in division Properties of Regular Languages of Automata Theory

Answer»

The correct answer is (a) n

For EXPLANATION I would SAY: The conversion DFA to NFA is simple, and takes O(n) TIME on an n-state DFA.

27.

If E= FG, E^r=?(a) F^rG^r(b) G^rF^r(c) Both (a) and (b)(d) None of the mentionedThe question was posed to me by my college professor while I was bunking the class.This question is from Reversal-Homomorphism and Inverse Homomorphism in chapter Properties of Regular Languages of Automata Theory

Answer»

Correct answer is (b) G^rF^r

The EXPLANATION: If E= FG, E^r=G^rF^r . EXAMPLE: (01*)R=(1*)R(0)R

28.

If L is a regular language, then (((L’)r)’)* is:(a) regular(b) non regular(c) may be regular(d) none of the mentionedI got this question in my homework.This key question is from Closure Properties under Boolean Operations topic in section Properties of Regular Languages of Automata Theory

Answer»

Correct OPTION is (a) REGULAR

To explain I WOULD say: If L is regular so is its complement, if L’ is regular so is its reverse, if (L’)^R is regular so is its Kleene.

29.

Which of the following fields may have pigeonhole principle violated?(a) Discrete mathematics(b) Computer Science(c) Quantum Mechanics(d) None of the mentionedThe question was posed to me by my college professor while I was bunking the class.Question is taken from Applications of Pumping Lemma/Pigeonhole principle topic in section Properties of Regular Languages of Automata Theory

Answer» RIGHT OPTION is (c) QUANTUM Mechanics

For explanation: Y Aharonov proved MATHEMATICALLY the violation of pigeon hole principle in Quantum mechanics and proposed inferometric experiments to test it.
30.

Which of the following fields may have pigeonhole principle violated?(a) Discrete mathematics(b) Computer Science(c) Quantum Mechanics(d) None of the mentionedI had been asked this question in exam.This intriguing question originated from Applications of Pumping Lemma/Pigeonhole principle topic in portion Properties of Regular Languages of Automata Theory

Answer»
31.

Which of the following cannot be converted in an ordinary NFA?(a) DFA(b) Regular Expression(c) e-NFA(d) None of the mentionedThe question was posed to me by my school teacher while I was bunking the class.This question is from Conversions among Representations in division Properties of Regular Languages of Automata Theory

Answer»

The correct choice is (d) None of the mentioned

To explain I would say: Each of the FOLLOWING can expressed in TERMS of ordinary NFA with DIFFERENT time COMPLEXITIES.

32.

Suppose a regular language L is closed under the operation halving, then the result would be:(a) 1/4 L will be regular(b) 1/2 L will be regular(c) 1/8 L will be regular(d) Al of the mentionedThis question was addressed to me by my college professor while I was bunking the class.Question is taken from Closure Properties under Boolean Operations in chapter Properties of Regular Languages of Automata Theory

Answer»

The correct OPTION is (d) Al of the mentioned

For explanation I WOULD say: At FIRST STAGE 1/2 L will be regular and subsequently, all the OPTIONS will be regular.

33.

If n objects are distributed over m places, and n < m, then some of the places receive:(a) at least 2 objects(b) at most 2 objects(c) no object(d) none of the mentionedThe question was asked during an online interview.My enquiry is from Applications of Pumping Lemma/Pigeonhole principle topic in division Properties of Regular Languages of Automata Theory

Answer»

Correct ANSWER is (c) no object

Explanation: This is one of the alternative formulations of the pigeon hole PRINCIPLE. As n < m, there will exist some PLACE which will not receive any of the object.

34.

Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What does these variables represent?(a) string count(b) string(c) both (a) and (b)(d) none ofthe mentionedThe question was asked during an interview.My query is from Pumping Lemma for Regular Language topic in portion Properties of Regular Languages of Automata Theory

Answer»

The correct choice is (a) string count

Best explanation: Given: w =xyz. Here, xyz individually represents STRINGS or RATHER substrings which wecompute over conditions to CHECK the REGULARITY of the language.

35.

Which among the following are the boolean operations that under which regular languages are closed?(a) Union(b) Intersection(c) Complement(d) All of the mentionedThis question was addressed to me in an interview for internship.Origin of the question is Closure Properties under Boolean Operations topic in division Properties of Regular Languages of Automata Theory

Answer»

Right option is (d) All of the mentioned

Best explanation: REGULAR LANGUAGES are CLOSED under the FOLLOWING operations:

a) Regular expression operations

b) Boolean operations

c) HOMOMORPHISM

d) Inverse Homomorphism

36.

If L is a language, the reversal of the language can be represented as:(a) L’(b) L^c(c) L^r(d) more than one option is correctI had been asked this question by my school principal while I was bunking the class.Query is from Reversal-Homomorphism and Inverse Homomorphism topic in chapter Properties of Regular Languages of Automata Theory

Answer»

Right option is (C) L^r

The best explanation: L^r is defined as the REVERSAL of a language. L^ris a set of strings whose reversal is in L.

Example: L={0, 01, 100}

Lr={0, 10, 001}

37.

If L1 and L2′ are regular languages, L1 ∩ (L2′ U L1′)’ will be(a) regular(b) non regular(c) may be regular(d) none of the mentionedI got this question in examination.My query is from Closure Properties under Boolean Operations in section Properties of Regular Languages of Automata Theory

Answer» RIGHT OPTION is (a) regular

Easiest EXPLANATION: If L1 is regular, so is L1′ and if L1′ and L2′ are regular so is L1′ U L2′. Further, regularlanguages are also CLOSED under intersection operation.
38.

With reference to Automaton to Regular Expression Conversion, for each of the n rounds, where n is the number of states of DFA, we can _________ the size of the regular expression constructed.(a) double(b) triple(c) quadruple(d) none of the mentionedThe question was posed to me in an interview for job.This intriguing question comes from Conversions among Representations in section Properties of Regular Languages of Automata Theory

Answer»

The correct answer is (c) quadruple

The explanation: We can quadruple the size of the REGULAR expression per ROUND. Thus, we can SIMPLY write n^3 expressions can TAKE time O(n^34^n), where n =number of states of the DFA.

39.

If A and B are regular languages, !(A’ U B’) is:(a) regular(b) non regular(c) may be regular(d) none of the mentionedThis question was addressed to me during an interview.The origin of the question is Closure Properties under Boolean Operations in chapter Properties of Regular Languages of Automata Theory

Answer» CORRECT choice is (a) regular

The BEST I can explain: If A and B are regular LANGUAGES, then A Ç B is a regular LANGUAGE andA ∩ B is equivalent to!(A’ U B’).
40.

The conversion of NFA to DFA can be done in:(a) exponential time(b) linear time(c) logarithmic time(d) all of the mentionedThe question was posed to me by my college professor while I was bunking the class.My question comes from Conversions among Representations in portion Properties of Regular Languages of Automata Theory

Answer»

Right CHOICE is (a) exponential time

The best explanation: We can eliminate e-transitions from an n STATE epsilon-NFA to BUILD an ordinary NFA in O(n^3) time, without CHANGING the number of states.Next, producing to DFA can take exponential time.

41.

Let h(L) be a language of regular expression abe*+e(ab)*. Simplify the h(L)(a) (ab)*+eab*(b) abe*+ea*b*(c) (ab)*(d) None of the mentionedI have been asked this question in examination.My enquiry is from Reversal-Homomorphism and Inverse Homomorphism in section Properties of Regular Languages of Automata Theory

Answer»

The CORRECT option is (c) (ab)*

Easy EXPLANATION: abe*+e(ab)*(Using the IDENTITIES e=e*, eE=Ee=E)

=ab+(ab)*=> ab will contain inside (ab)*, THUS =>(ab)*.

42.

Pigeonhole principle can be applied in the following computer science algorithms:(a) hashing algorithm(b) lossless compression algorithm(c) both (a) and (b)(d) none of the mentionedI had been asked this question during an interview.Query is from Applications of Pumping Lemma/Pigeonhole principle topic in section Properties of Regular Languages of Automata Theory

Answer»

Correct answer is (c) both (a) and (B)

Explanation: COLLISIONS are inevitable in a HASH table because the number of POSSIBLE keys exceeds the number of INDICES in the array.

43.

There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for some constant integer n.What can be the maximum length of the substring xy i.e. |xy|

Answer»

The correct option is (a) n

Easy explanation: It is the first CONDITIONAL statement of the lemma that states that |xy|<=n, i.e. the MAXIMUM length of the SUBSTRING xy in w can be n only.

44.

If d is a final state, which of the following is correct according to the given diagram?(a) x=p, y=qr, z=s(b) x=p, z=qrs(c) x=pr, y=r, z=s(d) All of the mentionedThe question was posed to me by my school principal while I was bunking the class.My question comes from Pumping Lemma for Regular Language in division Properties of Regular Languages of Automata Theory

Answer»

The correct choice is (a) x=p, y=QR, z=s

The BEST I can EXPLAIN: The FSA accepts the string pqrs. In TERMS of pumping lemma, the string pqrs is broken into an x portion an a, a y portion qr and a z portion s.

45.

Which of the following obey the closure properties of Regular language?(a) Homomorphism(b) Inverse Homomorphism(c) Reversal(d) All of the mentionedI have been asked this question by my school teacher while I was bunking the class.The question is from Reversal-Homomorphism and Inverse Homomorphism in chapter Properties of Regular Languages of Automata Theory

Answer»

Correct option is (d) All of the mentioned

For explanation: Homomorphism on an aphabet is a FUNCTION that gives a STRING for each SYMBOL in that alphabet. Example: h(0)=ab, ETC.