

InterviewSolution
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. |
Which of the following are non regular?(a) The set of strings in {a,b}* with an even number of b’s(b) The set of strings in {a, b, c}* where there is no c anywhere to the left of a(c) The set of strings in {0, 1}* that encode, in binary, an integer w that is a multiple of 3. Interpret the empty strings e as the number 0.(d) None of the mentionedI have been asked this question at a job interview.This intriguing question comes from Properties-Non Regular Languages in chapter Regular Expressions and Languages of Automata Theory |
Answer» Correct choice is (d) NONE of the mentioned |
|
2. |
The output of the lexical and syntax analyzer can stated as:(a) parse stream, parse tree(b) token tree, parse tree(c) token stream, parse tree(d) all of the mentionedI got this question in class test.The origin of the question is Lexical Analysis in division Regular Expressions and Languages of Automata Theory |
Answer» RIGHT CHOICE is (c) token stream, parse tree The best I can explain: The lexical analyzer outputs the stream of token which is taken up by SYNTAX analyzer one by one against the production rule and parse tree is generated. |
|
3. |
Which among the following statement is correct?Statement 1: When the analyzer scans ‘int’ and ‘intvalue’, it is not able to decide whether the int leads to a keyword or an identifier.Statement 2: Longest Match Rule(a) Statement 1 is assertion, Statement 2 is the reason(b) Statement 1 is assertion, Statement 2 is the solution(c) There is no such Statement 2(d) This is not a function of Lexical AnalyzerThis question was addressed to me in my homework.Question is taken from Lexical Analysis in section Regular Expressions and Languages of Automata Theory |
Answer» The CORRECT answer is (b) Statement 1 is assertion, Statement 2 is the solution |
|
4. |
State true or false:Statement:A lexical analyzer reads the source code line by line.(a) Statement:A lexical analyzer reads the source code line by line.(b) True(c) FalseThe question was posed to me during an online interview.I'm obligated to ask this question of Lexical Analysis topic in portion Regular Expressions and Languages of Automata Theory |
Answer» The correct option is (b) True |
|
5. |
Which of the following do Regexps do not find their use in?(a) search engines(b) word processors(c) sed(d) none of the mentionedThe question was asked in an interview.I need to ask this question from Converting Regular Expressions to Automata in division Regular Expressions and Languages of Automata Theory |
Answer» Right option is (d) none of the mentioned |
|
6. |
Regular expression are(a) Type 0 language(b) Type 1 language(c) Type 2 language(d) Type 3 languageThis question was addressed to me during an online interview.My question comes from Regular Language & Expression topic in section Regular Expressions and Languages of Automata Theory |
Answer» RIGHT OPTION is (a) TYPE 0 language Explanation: According to Chomsky HIERARCHY . |
|
7. |
Can the given state diagram be reduced?(a) Yes(b) NoI got this question by my school principal while I was bunking the class.I would like to ask this question from Conversion by Eliminating states in chapter Regular Expressions and Languages of Automata Theory |
Answer» Right CHOICE is (a) Yes |
|
8. |
Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be(a) {w | w is a string of odd length}(b) {w | w is a string of length multiple of 3}(c) {w | w is a string of length 3}(d) All of the mentionedThis question was posed to me in a national level competition.Question is from Building Regular Expressions in division Regular Expressions and Languages of Automata Theory |
Answer» The correct choice is (b) {w | w is a string of length multiple of 3} |
|
9. |
Which among the following can be an annihilator for multiplication operation?(a) 0(b) 1(c) 100(d) 22/7I had been asked this question in my homework.Question is from Finding Patterns in Text,Algebric Laws and Derivatives in division Regular Expressions and Languages of Automata Theory |
Answer» Correct answer is (a) 0 |
|
10. |
Which of the following pair of regular expression are not equivalent?(a) 1(01)* and (10)*1(b) x(xx)* and (xx)*x(c) (ab)* and a*b*(d) x+ and x*x+This question was addressed to me in an internship interview.Enquiry is from Regular Language & Expression in section Regular Expressions and Languages of Automata Theory |
Answer» The correct OPTION is (c) (AB)* and a*b* |
|
11. |
Precedence of regular expression in decreasing order is(a) * , . , +(b) . , * , +(c) . , + , *(d) + , a , *I have been asked this question in an interview.This intriguing question originated from Regular Language & Expression in section Regular Expressions and Languages of Automata Theory |
Answer» CORRECT CHOICE is (a) * , . , + To EXPLAIN: NONE. |
|
12. |
The behaviour of NFA can be simulated using DFA.(a) always(b) never(c) sometimes(d) none of the mentionedThe question was asked in my homework.The doubt is from Conversion by Eliminating states in portion Regular Expressions and Languages of Automata Theory |
Answer» RIGHT choice is (a) always Explanation: For EVERY NFA, there exists an EQUIVALENT DFA and vice VERSA. |
|
13. |
Which of the following represents a language which has no pair of consecutive 1’s if ∑= {0,1}?(a) (0+10)*(1+ε)(b) (0+10)*(1+ε)*(c) (0+101)*(0+ε)(d) (1+010)*(1+ε)I got this question in a national level competition.My question is based upon Building Regular Expressions topic in chapter Regular Expressions and Languages of Automata Theory |
Answer» CORRECT choice is (a) (0+10)*(1+ε) The best I can explain: All the options except ‘a’ accept those STRINGS which comprises minimum ONE PAIR of 1’s together. |
|
14. |
The appropriate precedence order of operations over a Regular Language is(a) Kleene, Union, Concatenate(b) Kleene, Star, Union(c) Kleene, Dot, Union(d) Star, Union, DotI got this question in quiz.The query is from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory |
Answer» Correct option is (c) Kleene, Dot, Union |
|
15. |
The given NFA corresponds to which of the following Regular expressions?(a) (0+1) *(00+11) (0+1) *(b) (0+1) *(00+11) *(0+1) *(c) (0+1) *(00+11) (0+1)(d) (0+1) (00+11) (0+1) *I got this question in exam.I'd like to ask this question from Regular Expression-Introduction topic in portion Regular Expressions and Languages of Automata Theory |
Answer» Correct choice is (a) (0+1) *(00+11) (0+1) * |
|
16. |
Myphill Nerodedoes the following:(a) Minimization of DFA(b) Tells us exactly when a language is regular(c) Both (a) and (b)(d) None of the mentionedThis question was posed to me by my college professor while I was bunking the class.This is a very interesting question from Properties-Non Regular Languages topic in chapter Regular Expressions and Languages of Automata Theory |
Answer» Correct option is (C) Both (a) and (b) |
|
17. |
Which of the following options is incorrect?(a) A language L is regular if and only if ~L has finite number of equivalent classes.(b) Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes L must have atmost k states.(c) A language L is NFA-regular if and only if it is DFA-regular.(d) None of the mentionedI had been asked this question by my college professor while I was bunking the class.Question is taken from Properties-Non Regular Languages topic in division Regular Expressions and Languages of Automata Theory |
Answer» The correct answer is (B) Let L be a regular language. If ~L has K equivalent classes, then any DFA that recognizes L must have ATMOST k states. |
|
18. |
If L is DFA-regular, L’ is(a) Non regular(b) DFA-regular(c) Non-finite(d) None of the mentionedI had been asked this question during an interview for a job.Question is from Properties-Non Regular Languages topic in section Regular Expressions and Languages of Automata Theory |
Answer» Correct choice is (b) DFA-regular |
|
19. |
Which of the following are not quantifiers?(a) Kleene plus +(b) Kleene star *(c) Question mark ?(d) None of the mentionedThis question was posed to me during an internship interview.My query is from Converting Regular Expressions to Automata in division Regular Expressions and Languages of Automata Theory |
Answer» Correct OPTION is (d) None of the mentioned |
|
20. |
The scanner outputs:(a) Stream of tokens(b) Image file(c) Intermediate code(d) Machine codeI have been asked this question during a job interview.Question is from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory |
Answer» RIGHT answer is (a) Stream of tokens Easy explanation: A scanner or a lexical ANALYZER takes a SOURCE code as input and OUTPUTS a stream of token after fragmenting the code. |
|
21. |
Regular expression Φ* is equivalent to(a) ϵ(b) Φ(c) 0(d) 1I got this question in an international level competition.The doubt is from Regular Language & Expression in portion Regular Expressions and Languages of Automata Theory |
Answer» | |
22. |
Which of the following methods is suitable for conversion of DFA to RE?(a) Brzozowski method(b) Arden’s method(c) Walter’s method(d) All of the mentionedThis question was addressed to me during an online interview.The origin of the question is Conversion by Eliminating states in division Regular Expressions and Languages of Automata Theory |
Answer» The CORRECT OPTION is (a) Brzozowski METHOD |
|
23. |
The minimum number of 1’s to be used in a regular expression of the given language:R(x): The language of all strings containing exactly 2 zeroes.(a) 2(b) 3(c) 0(d) 1The question was posed to me in an online quiz.The query is from Finding Patterns in Text,Algebric Laws and Derivatives topic in section Regular Expressions and Languages of Automata Theory |
Answer» The correct choice is (b) 3 |
|
24. |
L is a regular Language if and only If the set of __________ classes of IL is finite.(a) Equivalence(b) Reflexive(c) Myhill(d) NerodeThe question was posed to me during an interview.My question comes from Regular Expression-Introduction topic in chapter Regular Expressions and Languages of Automata Theory |
Answer» Correct option is (a) EQUIVALENCE |
|
25. |
The methodology to show an error when the analyzer faces a keyword over an user’s input is based on:(a) rule priority(b) longest match rule(c) keyword-out rule(d) none of mentionedI had been asked this question in an interview for internship.I'm obligated to ask this question of Lexical Analysis topic in section Regular Expressions and Languages of Automata Theory |
Answer» The correct OPTION is (a) RULE priority |
|
26. |
Generate the regular expression to match blank lines(a) / */(b) /bl(c) /^?/(d) /^(dollarSign)/The question was asked in an international level competition.Question is taken from Regular Expression in UNIX topic in portion Regular Expressions and Languages of Automata Theory |
Answer» Correct answer is (d) /^$/ |
|
27. |
According to the given language, which among the following expressions does it corresponds to? Language L={xϵ{0,1}|x is of length 4 or less}(a) (0+1+0+1+0+1+0+1)^4(b) (0+1)^4(c) (01)^4(d) (0+1+ε)^4I had been asked this question in examination.The above asked question is from Regular Expression-Introduction in section Regular Expressions and Languages of Automata Theory |
Answer» The correct ANSWER is (d) (0+1+ε)^4 |
|
28. |
Choose the incorrect process to check whether the string belongs to the language of certain variable or not?(a) recursive inference(b) derivations(c) head to body method(d) All of the mentionedI have been asked this question during an interview.I'm obligated to ask this question of Finding Patterns in Text,Algebric Laws and Derivatives in chapter Regular Expressions and Languages of Automata Theory |
Answer» Correct OPTION is (d) All of the mentioned |
|
29. |
Lexers and parsers are not found in which of the following?(a) compiler front end processing(b) prettyprinters(c) linters(d) none of the mentionedThe question was asked in quiz.Question is from Lexical Analysis topic in section Regular Expressions and Languages of Automata Theory |
Answer» The correct choice is (d) none of the mentioned |
|
30. |
Which of the following characters are ignored while lexical analysis?(a) .(b) =(c) #(d) WhiteSpaceI have been asked this question in an interview.Origin of the question is Lexical Analysis in portion Regular Expressions and Languages of Automata Theory |
Answer» The correct choice is (d) WhiteSpace |
|
31. |
Dot operator in regular expression resembles which of the following?(a) Expressions are juxtaposed(b) Expressions are multiplied(c) Cross operation(d) None of the mentionedI got this question in an online interview.Origin of the question is Building Regular Expressions topic in division Regular Expressions and Languages of Automata Theory |
Answer» Right answer is (a) Expressions are juxtaposed |
|
32. |
In order to represent a regular expression, the first step to create the transition diagram is:(a) Create the NFA using Null moves(b) Null moves are not acceptable, thus should not be used(c) Predict the number of states to be used in order to construct the Regular expression(d) None of the mentionedThis question was addressed to me in class test.This intriguing question comes from Operators of Regular Expression topic in chapter Regular Expressions and Languages of Automata Theory |
Answer» Right choice is (a) Create the NFA using Null moves |
|
33. |
(0+ε) (1+ε) represents(a) {0, 1, 01, ε}(b) {0, 1, ε}(c) {0, 1, 01 ,11, 00, 10, ε}(d) {0, 1}The question was asked in an interview.My question comes from Operators of Regular Expression in portion Regular Expressions and Languages of Automata Theory |
Answer» Correct choice is (a) {0, 1, 01, ε} |
|
34. |
Which of the following are related to tree automaton?(a) Myphill Nerode Theorem(b) State machine(c) Courcelle’s Theorem(d) All of the mentionedThe question was posed to me in a national level competition.This is a very interesting question from Properties-Non Regular Languages topic in section Regular Expressions and Languages of Automata Theory |
Answer» The CORRECT choice is (d) All of the mentioned |
|
35. |
If ∑= {0,1}, then Ф* will result to:(a) ε(b) Ф(c) ∑(d) None of the mentionedI had been asked this question in an interview for job.My question comes from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory |
Answer» The correct choice is (a) ε |
|
36. |
Which of the following is same as the given DFA?(a) (0+1)*001(0+1)*(b) 1*001(0+1)*(c) (01)*(0+0+1)(01)*(d) None of the mentionedI had been asked this question in final exam.The doubt is from DFA to Regular Expressions topic in division Regular Expressions and Languages of Automata Theory |
Answer» Right answer is (a) (0+1)*001(0+1)* |
|
37. |
Which of the following regular expressions represents the set of strings which do not contain a substring ‘rt’ if ∑= {r, t}(a) (rt)*(b) (tr)*(c) (r*t*)(d) (t*r*)I got this question in examination.Enquiry is from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory |
Answer» Right CHOICE is (d) (t*r*) |
|
38. |
Arden’s theorem is true for:(a) More than one initial states(b) Null transitions(c) Non-null transitions(d) None of the mentionedI have been asked this question in semester exam.My query is from Operators of Regular Expression topic in division Regular Expressions and Languages of Automata Theory |
Answer» Right option is (c) Non-null transitions |
|
39. |
P, O, R be regular expression over ∑, P is not ε, then R=Q + RP has a unique solution:(a) Q*P(b) QP*(c) Q*P*(d) (P*O*)*I got this question during an interview for a job.Asked question is from Operators of Regular Expression in chapter Regular Expressions and Languages of Automata Theory |
Answer» CORRECT answer is (b) QP* To elaborate: The given statement is the Arden’s Theorem and it tends to have a UNIQUE solution as QP*. Let P and Q be regular expressions, R=Q+RP R=Q+(Q+RP) P R=Q+((Q+RP) +RP) +P=Q+QP+RPP+RPP=Q+QP+(Q+RP) PP+(Q+RP) PP=Q+QP+QPP+RPPP+QPP+RPPP, If we do this recursively, we GET: R= QP* |
|
40. |
Which phase of compiler includes Lexical Analysis?(a) 1(b) 2(c) 3(d) Its primary function, not in any phaseThe question was asked during an online exam.I would like to ask this question from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory |
Answer» RIGHT answer is (a) 1 The best EXPLANATION: The first phase of compilation process is called lexical analysis. It fragments the SOURCE code into TOKEN which is the smallest programming unit of a program. |
|
41. |
Which of the following cannot be used to decide whether and how a given regexp matches a string:(a) NFA to DFA(b) Lazy DFA algorithm(c) Backtracking(d) None of the mentionedI had been asked this question during an interview.Question is taken from Converting Regular Expressions to Automata topic in division Regular Expressions and Languages of Automata Theory |
Answer» The CORRECT option is (d) None of the mentioned |
|
42. |
State true or false:Statement: The state removal approach identifies patterns within the graph and removes state, building up regular expressions along each transition.(a) Statement: The state removal approach identifies patterns within the graph and removes state, building up regular expressions along each transition.(b) true(c) falseThis question was addressed to me in an internship interview.My question is taken from Conversion by Eliminating states topic in chapter Regular Expressions and Languages of Automata Theory |
Answer» The correct option is (a) Statement: The STATE removal approach identifies patterns within the graph and removes state, building up REGULAR expressions along each transition. |
|
43. |
What does “X?” do regular expression operator?(a) Matches zero or more capital X’s.(b) Matches no or one occurence of the capital letter X.(c) Matches one or more capital X’s.(d) All of the mentionedI had been asked this question in an interview for job.This intriguing question originated from Regular Expression in UNIX in division Regular Expressions and Languages of Automata Theory |
Answer» Right choice is (b) MATCHES no or one OCCURENCE of the capital LETTER X. |
|
44. |
Which of the following is not a step in elimination of states procedure?(a) Unifying all the final states into one using e-transitions(b) Unify single transitions to multi transitions that contains union of input(c) Remove states until there is only starting and accepting states(d) Get the resulting regular expression by direct calculationThe question was asked in examination.Origin of the question is Conversion by Eliminating states in chapter Regular Expressions and Languages of Automata Theory |
Answer» The correct answer is (B) Unify single TRANSITIONS to multi transitions that contains union of input |
|
45. |
Which among the following are incorrect regular identities?(a) εR=R(b) ε*=ε(c) Ф*=ε(d) RФ=RThe question was posed to me in an interview for internship.My question comes from Operators of Regular Expression in chapter Regular Expressions and Languages of Automata Theory |
Answer» The correct ANSWER is (d) RФ=R |
|
46. |
The action of parsing the source code into proper syntactic classes is known as:(a) Parsing(b) Interpretation analysis(c) Lexicography(d) Lexical AnalysisThe question was posed to me during an online interview.My question comes from Lexical Analysis in section Regular Expressions and Languages of Automata Theory |
Answer» Right option is (d) Lexical Analysis |
|
47. |
If the lexical analyser finds a lexeme with the same name as that of a reserved word,it _________(a) overwrites the word(b) overwrites the functionality(c) generates an error(d) something elseI had been asked this question by my college professor while I was bunking the class.Enquiry is from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory |
Answer» The correct CHOICE is (c) generates an error |
|
48. |
If we have more than one accepting states or an accepting state with an outdegree, which of the following actions will be taken?(a) addition of new state(b) removal of a state(c) make the newly added state as final(d) more than one option is correctThis question was posed to me during an interview.Question is from Conversion by Eliminating states topic in section Regular Expressions and Languages of Automata Theory |
Answer» Correct choice is (d) more than one option is correct |
|
49. |
Which of the given regular expressions correspond to the automata shown?(a) (110+1)*0(b) (11+110)*1(c) (110+11)*0(d) (1+110)*1The question was posed to me in unit test.This interesting question is from DFA to Regular Expressions topic in portion Regular Expressions and Languages of Automata Theory |
Answer» Right answer is (c) (110+11)*0 |
|
50. |
Which of the following is not a regular expression?(a) [(a+b)*-(aa+bb)]*(b) [(0+1)-(0b+a1)*(a+b)]*(c) (01+11+10)*(d) (1+2+0)*(1+2)*This question was posed to me during an internship interview.This intriguing question comes from Regular Language & Expression topic in section Regular Expressions and Languages of Automata Theory |
Answer» Right OPTION is (B) [(0+1)-(0b+a1)*(a+b)]* |
|