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.

101.

NFAs are ________ DFAs.(a) Larger than(b) More expressive than(c) Less expressive than(d) Equally expressive asI got this question by my college director while I was bunking the class.My question is based upon Non-Deterministic Finite Automata in section Finite Automata and Regular Expression of Compiler

Answer»

Right OPTION is (a) Larger than

The EXPLANATION is: Because there is more NUMBER of STATES for an NDFA than for a DFA for a given expression.

102.

The subset construction shows that every NFA accepts a __________(a) String(b) Function(c) Regular language(d) Context-free languageThe question was posed to me in a job interview.I need to ask this question from Non-Deterministic Finite Automata in chapter Finite Automata and Regular Expression of Compiler

Answer»

The CORRECT choice is (c) Regular language

To ELABORATE: LIKE DFAs, NFAs only RECOGNIZE regular LANGUAGES.

103.

An NFA’s transition function returns ________(a) A Boolean value(b) A state(c) A set of states(d) An edgeI have been asked this question in an interview.Question is from Non-Deterministic Finite Automata in chapter Finite Automata and Regular Expression of Compiler

Answer»

Right CHOICE is (c) A SET of states

To EXPLAIN: A transition function Δ: Q × Σ → P (Q).Where P (Q) denotes the power set of Q.

104.

In Moore Machine O/P is associated with ____________(a) Present state(b) Next state(c) Input(d) None of the mentionedThis question was posed to me in class test.The query is from Finite Automata topic in section Finite Automata and Regular Expression of Compiler

Answer»

The CORRECT ANSWER is (a) Present STATE

Best explanation: The definition states that MOORE machines OUTPUT is determined by the current state only.

105.

Maximum number of states of a DFA converted from an NFA with nstates is?(a) n(b) n^2(c) 2n(d) None of the mentionedThis question was addressed to me in an interview for internship.My doubt is from Finite Automata in portion Finite Automata and Regular Expression of Compiler

Answer»

Right choice is (C) 2n

To EXPLAIN: Take the NFA with states {QO,q1}, alphabet Σ={a}, initial state q0, TRANSITIONS δ(q0,a)=q0, δ(q0,a)=q1 and FINAL state q1. It generates the same language as the DFA with the same set of states and alphabet, but transitions δ(q0,a)=q1 and δ(q1,a)=q1.

106.

An NFA may be converted to a DFA using __________(a) Induction(b) A construction(c) Contradiction(d) CompilationThis question was addressed to me during an online interview.I want to ask this question from Non-Deterministic Finite Automata topic in chapter Finite Automata and Regular Expression of Compiler

Answer»

Correct answer is (B) A construction

The explanation: SUBSET construction is used to convert a NFA into DFA.

107.

ε-transitions does not add any extra capacity of recognizing formal.(a) True(b) FalseI got this question in an online interview.This is a very interesting question from The NFA with epsilon in division Finite Automata and Regular Expression of Compiler

Answer» CORRECT CHOICE is (a) True

To explain: ε-transitions provides a convenient transition inthe SYSTEMS WHOSE current states are not precisely KNOWN.
108.

What is the complement of the language accepted by the NFA shown below? Assume ∑ = {a} and ε is the empty string.(a) Φ(b) ε(c) a(d) {a, ε}This question was posed to me in a job interview.My query is from Transformation from NFA to DFA in portion Finite Automata and Regular Expression of Compiler

Answer»

The correct answer is (B) ε

The explanation is: The given alphabet ∑ contains only one symbol {a} and the given NFA accepts all STRINGS with any NUMBER of OCCURRENCES of ‘a’. Hence the complement is an empty string.

109.

The lexical analysis for a modern language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?(a) Finite state automata(b) Deterministic pushdown automata(c) Non-deterministic pushdown automata(d) Turing machineThe question was posed to me during an online interview.I'd like to ask this question from Transformation from NFA to DFA in section Finite Automata and Regular Expression of Compiler

Answer» CORRECT answer is (a) Finite state automata

Explanation: Initially in LEXICAL ANALYSIS the program is divided into tokens. Tokens can be EXPRESSED as regular expressions: [a-zA-Z] [a-zA-Z0-9]*

the KEYWORD if is given by if.

Integers are given by [+-]? [0-9]+.
110.

In regular expressions, the operator ‘*’ stands for?(a) Concatenation(b) Selection(c) Iteration(d) AdditionThe question was posed to me in an online interview.My doubt is from Transformation from NFA to DFA in division Finite Automata and Regular Expression of Compiler

Answer»

The correct ANSWER is (C) Iteration

Easiest EXPLANATION: It INDICATES iterations which can vary from zero to any NUMBER.

111.

Can a DFA simulate NDFA?(a) No(b) Yes(c) Sometimes(d) Depends on NDFAThis question was addressed to me in an online quiz.I want to ask this question from Transformation from NFA to DFA in section Finite Automata and Regular Expression of Compiler

Answer»

Right option is (B) YES

Explanation: Yes it can be done through POWER set CONSTRUCTION.

112.

Like DFAs, NFAs only recognize regular languages.(a) True(b) FalseI have been asked this question by my college director while I was bunking the class.I want to ask this question from Non-Deterministic Finite Automata topic in chapter Finite Automata and Regular Expression of Compiler

Answer»

Right ANSWER is (a) True

The BEST I can EXPLAIN: It is a known fact.

113.

NDFAs where introduced by ____________(a) Michael O Rabin & Dana Scott(b) Dan Brown(c) Sun micro system Labs(d) SAP LabsI got this question in exam.I would like to ask this question from Non-Deterministic Finite Automata in portion Finite Automata and Regular Expression of Compiler

Answer» CORRECT option is (a) Michael O RABIN & Dana Scott

Easiest explanation: NFAS were introduced Dana Scott and Michael O. Rabinwho also SHOWED their equivalence to DFAS.
114.

What are the basic limitations of finite state machine?(a) It cannot remember arbitrarily large amount of information(b) In cannot remember state transitions(c) In cannot remember grammar for a language(d) It cannot remember language generated from a grammarThis question was addressed to me during an interview.The query is from Finite Automata topic in division Finite Automata and Regular Expression of Compiler

Answer»

Correct option is (b) In cannot remember STATE transitions

Explanation: Because it does to STORE its PREVIOUS state of the TRANSITION.

115.

What is the transitional function of a DFA?(a) Q X Σ→Q(b) Q X Σ→2Q(c) Q X Σ→2n(d) Q X Σ→QnThis question was posed to me during an interview.I want to ask this question from Finite Automata topic in section Finite Automata and Regular Expression of Compiler

Answer» CORRECT option is (a) Q X Σ→Q

To explain I would say: Q is the FINITE SET and let be a finite set of symbols so Q X Σ fives no of states.