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.
| 51. |
A ________ is a string of characters which form a syntactic unit.(a) Lexeme(b) Lex(c) Lexeme & Lex(d) None of the mentionedThe question was posed to me in final exam.Query is from Lexical Analyser in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT answer is (a) LEXEME |
|
| 52. |
Regular expressions are used to represent which language?(a) Recursive language(b) Context free language(c) Regular language(d) All of the mentionedI had been asked this question in class test.My question is based upon Obtaining the regular Expression from the Finite automata in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT choice is (c) REGULAR language To explain: Regular EXPRESSION is REPRESENTED by regular language. |
|
| 53. |
The process of forming tokens from an input stream of characters is called __________(a) Liberalisation(b) Characterisation(c) Tokenization(d) None of the mentionedThis question was addressed to me during a job interview.This is a very interesting question from Lexical Analyser in division Finite Automata and Regular Expression of Compiler |
|
Answer» The correct option is (c) TOKENIZATION |
|
| 54. |
Which of the following regular expression denotes zero or more instances of an a or b?(a) a/b(b) (a/b)*(c) (ab)*(d) a*IbThis question was posed to me by my college professor while I was bunking the class.My doubt stems from Obtaining the regular Expression from the Finite automata topic in portion Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT ANSWER is (B) (a/b)* Easiest explanation: This expression gives o or more INSTANCES of a or b. |
|
| 55. |
Which one is a type of Lexeme?(a) Identifiers(b) Constants(c) Keywords(d) All of the mentionedThis question was posed to me in homework.Query is from Lexical Analyser topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The correct ANSWER is (d) All of the mentioned |
|
| 56. |
W hat is the complement of the language accepted by the NFA shown below?(a) A,B(b) B(c) C(d) D,CThis question was posed to me in an internship interview.Question is taken from Minimization of DFA in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT OPTION is (B) B |
|
| 57. |
_________ a phase of a compiler that maps the IR program into the instruction set and the finite resources of the target machine.(a) Optimizer(b) Parser(c) Optimizer & Parser(d) None of the mentionedThis question was posed to me in an international level competition.I'm obligated to ask this question of The NFA with epsilon-moves to the DFA-2 in division Finite Automata and Regular Expression of Compiler |
|
Answer» Correct answer is (d) None of the mentioned |
|
| 58. |
Let L1 = {w ∈ {0,1}∗ | w has at least as many occurrences of (110)’s as (011)’s}.Let L2 = { ∈ {0,1}∗ | w has at least as many occurrences of (000)’s as (111)’s}.Which one of the following is TRUE?(a) L1 is regular but not L2(b) L2 is regular(c) L1 and L2 are regular(d) Neither of them are regularThis question was addressed to me at a job interview.My query is from Minimization of DFA topic in portion Finite Automata and Regular Expression of Compiler |
|
Answer» Right choice is (a) L1 is regular but not L2 |
|
| 59. |
In a compiler the module that checks every character of the source text is called __________(a) The code generator(b) The code optimizer(c) The lexical analyzer(d) The syntax analyzerThis question was posed to me during an online exam.Asked question is from Lexical Analyser topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The correct ANSWER is (a) The code generator |
|
| 60. |
The set of all strings over ∑ = {a,b} in which all strings having bbbb as substring is?(a) (a+b)* bbbb (a+b)*(b) (a+b)* bb (a+b)*bb(c) bbb(a+b)*(d) bb (a+b)*This question was posed to me in class test.This interesting question is from Obtaining the regular Expression from the Finite automata in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT OPTION is (a) (a+b)* bbbb (a+b)* |
|
| 61. |
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) N^2(b) 2^N(c) 2N(d) N!This question was addressed to me during an internship interview.The above asked question is from Obtaining the regular Expression from the Finite automata in portion Finite Automata and Regular Expression of Compiler |
|
Answer» Correct OPTION is (C) 2N |
|
| 62. |
__________ a part of a compiler that takes as input a stream of characters and produces as output a stream of words along with their associated syntactic categories.(a) Parser(b) Optimizer(c) Scanner(d) None of the mentionedThis question was addressed to me at a job interview.My enquiry is from The NFA with epsilon-moves to the DFA-2 in section Finite Automata and Regular Expression of Compiler |
|
Answer» Correct choice is (C) SCANNER |
|
| 63. |
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=LI got this question by my college director while I was bunking the class.This intriguing question comes from Obtaining the regular Expression from the Finite automata topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» Correct answer is (b) L1 = {0, 1}* – L |
|
| 64. |
The grammar G: S → SS | a | b is ambiguous. Check all and only the strings that have exactly two leftmost derivations in G.(a) bbb(b) ab(c) All of the mentioned(d) None of the mentionedThis question was addressed to me by my college director while I was bunking the class.The above asked question is from The NFA with n-moves to the DFA topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» Correct CHOICE is (C) All of the mentioned |
|
| 65. |
An NFA is nothing more than an ε-NFA with no ε transitions.(a) True(b) FalseThis question was addressed to me by my school teacher while I was bunking the class.My query is from The NFA with epsilon-moves to the DFA-2 topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT answer is (a) True |
|
| 66. |
_________an IR-to-IR transformer that tries to improve the IR program in some way.(a) Optimizer(b) Parser(c) All of the mentioned(d) None of the mentionedThis question was posed to me in homework.I'm obligated to ask this question of The NFA with epsilon-moves to the DFA-2 topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» Right answer is (a) Optimizer |
|
| 67. |
NFA-εs are defined because certain properties can be more easily proved on them as compared to NFA.(a) True(b) FalseThis question was addressed to me by my school teacher while I was bunking the class.Question is from The NFA with epsilon in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The correct choice is (a) True |
|
| 68. |
For every NFA a deterministic finite automaton (DFA) can be found that accepts the same language.(a) True(b) FalseThis question was posed to me in an interview.My doubt is from Non-Deterministic Finite Automata in portion Finite Automata and Regular Expression of Compiler |
|
Answer» The correct choice is (a) True |
|
| 69. |
Which is the application of NFA?(a) A regular language is produced by union of two regular languages(b) The concatenation of two regular languages is regular(c) The Kleene closure of a regular language is regular(d) All of the mentionedThe question was asked in an international level competition.Origin of the question is Non-Deterministic Finite Automata in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» RIGHT ANSWER is (d) All of the mentioned Easiest EXPLANATION: As PER its DEFINITION. |
|
| 70. |
Which of the following statement is true for Moore Machine?(a) Output depends on present state(b) Output depends on present input(c) Output depends on present state and present input(d) Output depends on present state and past inputThis question was addressed to me in a job interview.This key question is from Finite Automata topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT choice is (a) Output depends on present STATE The best I can explain: The DEFINITION STATES that moore machines output is determined by the CURRENT state only. |
|
| 71. |
Which of the following is a correct statement?(a) { If an bn| n = 0,1, 2, 3 ..} is regular language(b) Strings with equal number of a’s and b’s denies a regular language(c) L (A* B*)∩ B gives the set A(d) None of the mentionedI had been asked this question during an interview.This intriguing question comes from The NFA with epsilon topic in section Finite Automata and Regular Expression of Compiler |
|
Answer» RIGHT option is (c) L (A* B*)∩ B gives the set A Best explanation: If we include A and B in a set and if we write A*it means exceptthen A i.e. Bsame asB*means EXCEPT then B i.e. so if we INTERSECT (A*B*)and Bthen get Abecause in any regular language. If we write A-B then A-B=A intersection B’so if we intersect A and B means A-BSo the intersection of (A*B*) and B= (BA). intersection Bmeans (BA)-B’ and B’=A so (BA) intersection(A)=A. |
|
| 72. |
S –> aSa| bSb| a| b; the language generated by the above grammar is the set of ____________(a) All palindromes(b) All odd length palindromes(c) Strings beginning and ending with the same symbol(d) All even length palindromesThis question was posed to me by my college director while I was bunking the class.Enquiry is from The NFA with epsilon in section Finite Automata and Regular Expression of Compiler |
|
Answer» The correct choice is (b) All odd length PALINDROMES |
|
| 73. |
A regular language corresponds to __________(a) An alphabet(b) Set of strings over an alphabet(c) A DFA only(d) A DFA or an NFAThe question was posed to me in a national level competition.Question is taken from Non-Deterministic Finite Automata topic in section Finite Automata and Regular Expression of Compiler |
|
Answer» RIGHT ANSWER is (B) Set of STRINGS over an alphabet To EXPLAIN: A regular grammar takes in all strings over an alphabet. |
|
| 74. |
The string WWR is not recognized by any FSM because _____________(a) An FSM cannot remember arbitrarily large amount of information(b) An FSM cannot fix the midpoint(c) An FSM cannot match W with WR(d) An FSM cannot remember first and last inputsI have been asked this question in exam.Query is from Finite Automata in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The correct CHOICE is (b) An FSM cannot FIX the midpoint |
|
| 75. |
What is the transitional function of an NFA?(a) Q X Σ→Q(b) Q X Σ→2Q(c) Q X Σ→2n(d) Q X Σ→QnI got this question during an online exam.This interesting question is from Finite Automata in division Finite Automata and Regular Expression of Compiler |
|
Answer» The correct option is (b) Q X Σ→2Q |
|
| 76. |
Does epsilon ring any change in the automata.(a) Yes(b) NoThis question was addressed to me during an online interview.My query is from The NFA with epsilon topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» Correct CHOICE is (B) No |
|
| 77. |
Which behaviour of a NFA can be stimulated by DFA?(a) Always(b) Sometimes(c) Never(d) Depends on NFAThe question was posed to me in final exam.This interesting question is from Transformation from NFA to DFA in division Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT choice is (a) Always For explanation: It can be DONE through POWER set CONSTRUCTION. |
|
| 78. |
Is an ordinary NFA and a NFA-ε are equivalent.(a) True(b) FalseI have been asked this question in an interview for job.My doubt stems from The NFA with epsilon topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» Right choice is (a) True |
|
| 79. |
Find the wrong statement?(a) The language accepted by finite automata are the languages denoted by regular expression(b) Every DFA has a regular expression denoting its language(c) For a regular expression r, there does not exists NDFA with L® ant transit that accept(d) None of the mentionedI have been asked this question during a job interview.My enquiry is from Transformation from NFA to DFA topic in section Finite Automata and Regular Expression of Compiler |
|
Answer» Correct OPTION is (c) For a regular expression R, there does not EXISTS NDFA with L® ant transit that accept |
|
| 80. |
Conversion of a DFA to an NFA __________(a) Is impossible(b) Requires the subset construction(c) Is Chancy(d) Is nondeterministicI have been asked this question at a job interview.I would like to ask this question from Non-Deterministic Finite Automata topic in section Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT option is (B) Requires the subset construction |
|
| 81. |
Which type of string is accepted by the following finite automata?(a) All string(b) Null string(c) No string(d) None of the mentionedThe question was posed to me in an interview.My doubt stems from Finite Automata topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» Right answer is (b) NULL string |
|
| 82. |
The regular languages are not closed under ___________(a) Concatenation(b) Union(c) Kleene star(d) ComplementThis question was addressed to me in a job interview.My question is based upon Non-Deterministic Finite Automata topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» Correct choice is (d) Complement |
|
| 83. |
Which of the following statement is true for Mealy Machine?(a) Output depends on present state(b) Output depends on present input(c) Output depends on present state and present input(d) Output depends on present state and past inputI got this question in semester exam.My question is taken from Finite Automata in portion Finite Automata and Regular Expression of Compiler |
|
Answer» Right OPTION is (c) OUTPUT depends on PRESENT state and present input |
|
| 84. |
The Tuples for NDFA is ___________(a) ∑, Q, q0, F, δ(b) Q, q0, F, δ(c) Θ, Q, q0, F,δ(d) F, Q, Δ, q0, δThis question was addressed to me during an interview.I need to ask this question from Non-Deterministic Finite Automata in section Finite Automata and Regular Expression of Compiler |
|
Answer» Correct ANSWER is (a) ∑, Q, q0, F, δ |
|
| 85. |
Which is true for in accessible state?(a) It cannot be reached anytime(b) There is no necessity of the state(c) If control enters no way to come out from the state(d) If control enters FA deadsI got this question in my homework.Question is from Finite Automata in portion Finite Automata and Regular Expression of Compiler |
|
Answer» The correct ANSWER is (a) It cannot be REACHED anytime |
|
| 86. |
Which one is a FALSE statement?(a) There exists a unique DFA for every regular language(b) NFA can always are converted to a PDA(c) Complement of CFL is always recursive(d) Every NDFA can be converted to a DFAI got this question in quiz.The doubt is from The NFA with epsilon topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» RIGHT answer is (d) Every NDFA can be converted to a DFA Easy explanation: Deterministic PDA cannot handle languages or GRAMMARS with ambiguity, but NDFA can handle with ambiguous languages as well as context-free grammar. Hence not every Ndfa can be converted to DFA. |
|
| 87. |
For any DFA state {qi,qj…qm} If some qj is a final state in the NFA Then {qi,qj…qm}, is a final state in the DFA.(a) True(b) FalseThis question was posed to me in semester exam.Origin of the question is Transformation from NFA to DFA in portion Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT CHOICE is (a) True Explanation: It the standard procedure to CONVERT NFA to DFA. |
|
| 88. |
Is empty string a valid input in Ndfa.(a) True(b) FalseThis question was posed to me in an online quiz.This key question is from Transformation from NFA to DFA in division Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT CHOICE is (a) True |
|
| 89. |
Which of the following CFG’s can’t be simulated by an FSM?(a) S->Sa/b(b) S->aSb/ab(c) S->abX, X->cY, Y->d/aX(d) None of the mentionedThe question was asked in an online quiz.This interesting question is from The NFA with epsilon in division Finite Automata and Regular Expression of Compiler |
|
Answer» Correct CHOICE is (b) S->aSb/ab |
|
| 90. |
E(q) is known ε-closure of q.(a) True(b) FalseThis question was posed to me by my school teacher while I was bunking the class.I want to ask this question from The NFA with epsilon in division Finite Automata and Regular Expression of Compiler |
|
Answer» Right answer is (a) True |
|
| 91. |
Regular expression a/b denotes which of the following set?(a) {a}(b) {€,a,b}(c) {a,b}(d) {ab}The question was asked by my college professor while I was bunking the class.Asked question is from Transformation from NFA to DFA topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» The CORRECT answer is (C) {a,b} |
|
| 92. |
A language L from a grammar G = { VN, Σ, P, S} is?(a) Set of symbols over VN(b) Set of symbols over Σ(c) Set of symbols over P(d) Set of symbols over SThe question was posed to me in an online quiz.Enquiry is from Finite Automata in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» Right CHOICE is (b) SET of SYMBOLS over Σ |
|
| 93. |
Which of the following statement is true for Dead State?(a) It cannot be reached anytime(b) There is no necessity of the state(c) If control enters no way to come out from the state(d) If control enters FA deadsThe question was asked by my college professor while I was bunking the class.My question is taken from Finite Automata topic in section Finite Automata and Regular Expression of Compiler |
|
Answer» Right choice is (c) If control enters no way to come out from the STATE |
|
| 94. |
Myhill-Nerode Theorem is used for __________(a) Minimization of DFA(b) Maximization of NFA(c) Conversion of NFA(d) Conversion of DFAThis question was posed to me in an interview.My question comes from Finite Automata in division Finite Automata and Regular Expression of Compiler |
|
Answer» Correct choice is (a) MINIMIZATION of DFA |
|
| 95. |
A nondeterministic finite automation with ε-moves is an extension of nondeterministic finite automation.(a) True(b) FalseI got this question by my college professor while I was bunking the class.I need to ask this question from The NFA with epsilon topic in chapter Finite Automata and Regular Expression of Compiler |
|
Answer» RIGHT ANSWER is (a) True To ELABORATE: Both are EQUIVALENT. |
|
| 96. |
In Mealy Machine O/P is associated with ____________(a) Present state(b) Next state(c) Input(d) None of the mentionedI had been asked this question in my homework.I need to ask this question from Finite Automata in portion Finite Automata and Regular Expression of Compiler |
|
Answer» Correct ANSWER is (b) NEXT state |
|
| 97. |
The transitions which does not take an input symbol are called ___________(a) ε-transitions(b) λ-transitions(c) ε-transitions & λ-transitions(d) none of the mentionedI got this question in my homework.My question comes from The NFA with epsilon topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT answer is (c) ε-transitions & λ-transitions Easy EXPLANATION: The transitions TAKING an INPUT symbol are called ε-transitions or λ-transitions. |
|
| 98. |
A finite automata recognizes ____________(a) Any Language(b) Context Sensitive Language(c) Context Free Language(d) Regular LanguageThis question was posed to me in an internship interview.My doubt is from Finite Automata in division Finite Automata and Regular Expression of Compiler |
|
Answer» Correct option is (d) Regular Language |
|
| 99. |
What is the relation between NFA-accepted languages and DFA accepted languages?(a) >(b) |
|
Answer» The correct OPTION is (c) = |
|
| 100. |
The definition of a language L with alphabet {a} is given as following. L = { ank | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L?(a) k+1(b) n+1(c) 2n+1(d) 2k+1I have been asked this question during an interview for a job.This intriguing question comes from Transformation from NFA to DFA topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT CHOICE is (b) N+1 To explain I would SAY: NOTE that n is a constant and k is any positive integer. For example, let n=3, then the DFA must be able to accept aaa, aaaaaa, aaaaaaaaa, , .. build such a DFA, 4 states are required. |
|