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.

Which of the following are context free language?(a) L={a^ib^i|i>=0}(b) L={ww^r| w is a string and r represents reverse}(c) Both (a) and (b)(d) one of the mentionedThe question was posed to me by my school teacher while I was bunking the class.My enquiry is from DPDA and Ambiguous Grammars topic in chapter Push Down Automata of Automata Theory

Answer»

Right CHOICE is (a) L={a^ib^i|i>=0}

To elaborate: NONE.

2.

|-* is the __________ closure of |-(a) symmetric and reflexive(b) transitive and reflexive(c) symmetric and transitive(d) none of the mentionedThe question was asked in an online interview.My doubt stems from Deterministic PDA in portion Push Down Automata of Automata Theory

Answer»

Correct OPTION is (b) transitive and reflexive

Easiest explanation: A STRING w is accepted by a PDA if and only if (s,w, E) |-* (F, e, e)

3.

Which among the following is not a part of the Context free grammar tuple?(a) End symbol(b) Start symbol(c) Variable(d) ProductionThis question was posed to me in semester exam.Question is taken from PDA-acceptance by Empty Stack topic in division Push Down Automata of Automata Theory

Answer»

Right answer is (a) End symbol

The explanation: The tuple DEFINITION of context free grammar is: (V, T, P, S) where V=set of VARIABLES, T=set of terminals, P=production, S= STARTING Variable.

4.

Halting states are of two types. They are:(a) Accept and Reject(b) Reject and Allow(c) Start and Reject(d) None of the mentionedThis question was posed to me during an interview.I need to ask this question from From Grammars to Push Down Automata topic in chapter Push Down Automata of Automata Theory

Answer»

Right choice is (a) ACCEPT and REJECT

For explanation: Halting states are the new tuple members introduced in turing MACHINE and is of TWO types: Accept Halting STATE and Reject Halting State.

5.

A non deterministic two way, nested stack automaton has n-tuple definition. State the value of n.(a) 5(b) 8(c) 4(d) 10I have been asked this question in an interview.The origin of the question is PDA-Acceptance by Final State in chapter Push Down Automata of Automata Theory

Answer»

Correct answer is (d) 10

To elaborate: The 10-tuple can be STATED as: NSA=‹Q,Σ,Γ,δ,q0,Z0,F,[,],]›.

6.

State true or false:Statement: The operations of PDA never work on elements, other than the top.(a) Statement: The operations of PDA never work on elements, other than the top.(b) true(c) falseThe question was asked during an internship interview.My question is based upon PDA-Acceptance by Final State topic in division Push Down Automata of Automata Theory

Answer»

Right choice is (a) Statement: The operations of PDA NEVER work on elements, other than the top.

For explanation I WOULD say: The term pushdown refers to the fact that the elements are pushed down in the stack and as PER the LIFO principle, the operation is always performed on the top ELEMENT of the stack.

7.

Which of the following regular expression allows strings on {a,b}* with length n where n is a multiple of 4.(a) (a+b+ab+ba+aa+bb+aba+bab+abab+baba)*(b) (bbbb+aaaa)*(c) ((a+b)(a+b)(a+b)(a+b))*(d) None of the mentionedThis question was posed to me in a national level competition.Query is from Regular Languages and D-PDA topic in section Push Down Automata of Automata Theory

Answer»

Correct answer is (c) ((a+b)(a+b)(a+b)(a+b))*

Best EXPLANATION: Other mentioned options do not MANY of the combinations while OPTION c SEEMS most RELIABLE.

8.

Let T={p, q, r, s, t}. The number of strings in S* of length 4 such that no symbols can be repeated.(a) 120(b) 625(c) 360(d) 36This question was addressed to me in an international level competition.My question is taken from Regular Languages and D-PDA in division Push Down Automata of Automata Theory

Answer»

Correct OPTION is (b) 625

To ELABORATE: USING the permutation rule, we can calculate that there will be TOTAL of 625 permutations on 5 elements TAKING 4 as the length.

9.

Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?(a) Moves(b) transition function(c) or/not symbol(d) none of the mentionedThe question was asked in my homework.My query is from From Grammars to Push Down Automata topic in chapter Push Down Automata of Automata Theory

Answer»

Correct answer is (a) MOVES

To EXPLAIN: Using this NOTATION, we can DEFINE moves and further acceptance of a string by the machine.

10.

If P is the production, for the given statement, state true or false.(a) * represents that the left hand side production rule has no right or left context.(b) true(c) falseI had been asked this question in an interview.My doubt stems from DPDA and Context Free Languages in portion Push Down Automata of Automata Theory

Answer»

The CORRECT OPTION is (a) * represents that the left hand side PRODUCTION rule has no RIGHT or left context.

The best explanation: Here the production P is from the DEFINITION of Context free grammar and thus, has no right or left context.

11.

A CFG consist of the following elements:(a) a set of terminal symbols(b) a set of non terminal symbols(c) a set of productions(d) all of the mentionedI got this question in a national level competition.My doubt is from DPDA and Context Free Languages in division Push Down Automata of Automata Theory

Answer»
12.

A language is accepted by a push down automata if it is:(a) regular(b) context free(c) both (a) and (b)(d) none of the mentionedThe question was asked during an online exam.My question is based upon Regular Languages and D-PDA in section Push Down Automata of Automata Theory

Answer» CORRECT option is (c) both (a) and (B)

To elaborate: All the REGULAR languages are the subset to context free languages and THUS can be accepted USING push down automata.
13.

State true or false:= L(M) and vice versa.(a) = L(M) and vice versa.(b) true(c) falseI have been asked this question during an online interview.Query is from Deterministic PDA topic in chapter Push Down Automata of Automata Theory

Answer»

The CORRECT option is (a) = L(M) and vice versa.

To elaborate: There exists TWO lemma’s such that:

a) Given a grammar G, construct the PDA and SHOW the equivalence

b) Given a PDA, construct a grammar and show the equivalence

14.

With reference of a DPDA, which among the following do we perform from the start state with an empty stack?(a) process the whole string(b) end in final state(c) end with an empty stack(d) all of the mentionedI got this question during an interview for a job.My question is from Deterministic PDA topic in chapter Push Down Automata of Automata Theory

Answer»

Right answer is (d) all of the mentioned

The best I can EXPLAIN: The empty STACK in the END is our requirement relative to finite state automatons.

15.

The closure property of context free grammar includes :(a) Kleene(b) Concatenation(c) Union(d) All of the mentionedThis question was addressed to me during an online interview.The above asked question is from PDA-acceptance by Empty Stack in chapter Push Down Automata of Automata Theory

Answer»

Right choice is (d) All of the mentioned

To explain: CONTEXT FREE GRAMMARS are CLOSED under kleene operation, union and CONCATENATION too.

16.

A push down automaton employs ________ data structure.(a) Queue(b) Linked List(c) Hash Table(d) StackThe question was posed to me by my school teacher while I was bunking the class.My doubt is from PDA-Acceptance by Final State in portion Push Down Automata of Automata Theory

Answer»

The correct option is (d) Stack

The explanation is: A push down automata uses a stack to carry out its OPERATIONS. They are more CAPABLE than the finite AUTOMATONS but LESS than the turing model.

17.

a→b Restriction: Length of b must be atleast as much length of a. Which of the following is correct for the given assertion?(a) Greibach Normal form(b) Context Sensitive Language(c) Chomsky Normal form(d) Recursively Ennumerable languageI have been asked this question in unit test.Question is from DPDA and Context Free Languages topic in portion Push Down Automata of Automata Theory

Answer»

The CORRECT OPTION is (b) Context Sensitive Language

The explanation is: A context-sensitive grammar (CSG) is a formal grammar in which the left-hand sides and right-hand sides of any production RULES may be surrounded by a context of terminal and non terminal symbols. Context-sensitive GRAMMARS are more general than context-free grammars, in the SENSE that there are some languages that cannot be described by context-free grammars, but can be described by CSG.

18.

Context free grammar is called Type 2 grammar because of ______________ hierarchy.(a) Greibach(b) Backus(c) Chomsky(d) None of the mentionedThe question was posed to me during an online interview.My question is from DPDA and Context Free Languages in section Push Down Automata of Automata Theory

Answer»

Right answer is (c) CHOMSKY

For explanation I would say: Chomsky HIERARCHY DECIDE four type of language :Type 3- REGULAR Language, Type 2-Context free language, Type 1-Context Sensitive Language, Type 0- Unrestricted or Recursively Ennumerable language.

19.

A PDA machine configuration (p, w, y) can be correctly represented as:(a) (current state, unprocessed input, stack content)(b) (unprocessed input, stack content, current state)(c) (current state, stack content, unprocessed input)(d) none of the mentionedI had been asked this question in final exam.My question is taken from Deterministic PDA in division Push Down Automata of Automata Theory

Answer»

Correct choice is (a) (CURRENT STATE, unprocessed input, STACK content)

To ELABORATE: A machine CONFIGURATION is an element of K×Σ*×Γ*.

(p,w,γ) = (current state, unprocessed input, stack content).

20.

Which of the following is an incorrect regular expression identity?(a) R+f=R(b) eR=e(c) Rf=f(d) None of the mentionedThis question was addressed to me by my school principal while I was bunking the class.This intriguing question comes from Regular Languages and D-PDA topic in section Push Down Automata of Automata Theory

Answer»

Correct choice is (b) eR=E

For explanation I WOULD say: e is the IDENTITY for concatenation. Thus, eR=R.

21.

Which of the following allows stacked values to be sub-stacks rather than just finite symbols?(a) Push Down Automaton(b) Turing Machine(c) Nested Stack Automaton(d) None of the mentionedThe question was asked in an interview for internship.My doubt stems from PDA-Acceptance by Final State topic in portion Push Down Automata of Automata Theory

Answer»

The CORRECT choice is (c) Nested Stack Automaton

To EXPLAIN: In computational theory, a nested stack automaton is a finite automaton which makes USE of stack containing data which can be ADDITIONAL STACKS.

22.

If the partial derivation tree contains the root as the starting variable, the form is known as:(a) Chomsky hierarchy(b) Sentential form(c) Root form(d) None of the mentionedThe question was posed to me in a national level competition.My doubt is from DPDA and Context Free Languages topic in division Push Down Automata of Automata Theory

Answer»

The CORRECT option is (b) Sentential form

For explanation: Example: For any grammar, productions be:

S->AB

A->AAA| ^

B->Bb| ^

The partial derivation TREE can be drawn as:

SINCE it has the root as S, this can be said to be in sentential form.

23.

The production of the form A->B , where A and B are non terminals is called(a) Null production(b) Unit production(c) Greibach Normal Form(d) Chomsky Normal FormThis question was addressed to me in a job interview.I'd like to ask this question from From Grammars to Push Down Automata topic in section Push Down Automata of Automata Theory

Answer»

The CORRECT answer is (b) Unit production

Explanation: A->ε is termed as NULL production while A->B is termed as Unit production.

24.

A null production can be referred to as:(a) String(b) Symbol(c) Word(d) All of the mentionedThe question was asked by my school principal while I was bunking the class.My question is taken from PDA-acceptance by Empty Stack topic in portion Push Down Automata of Automata Theory

Answer»

The correct option is (a) STRING

To explain I would say: Null production is ALWAYS TAKEN as a string in computational THEORY.

25.

Push down automata accepts _________ languages.(a) Type 3(b) Type 2(c) Type 1(d) Type 0This question was posed to me in an online interview.I would like to ask this question from PDA-Acceptance by Final State topic in section Push Down Automata of Automata Theory

Answer» CORRECT choice is (b) TYPE 2

Easiest explanation: Push down automata is for CONTEXT free languages and they are termed as Type 2 languages according to CHOMSKY hierarchy.
26.

A DPDA is a PDA in which:(a) No state p has two outgoing transitions(b) More than one state can have two or more outgoing transitions(c) Atleast one state has more than one transitions(d) None of the mentionedI got this question in an international level competition.This interesting question is from Deterministic PDA topic in section Push Down Automata of Automata Theory

Answer»

Right ANSWER is (a) No state p has two OUTGOING transitions

The explanation is: A DETERMINISTIC Push Down AUTOMATA is a Push Down Automata in which no state p has two or more transitions.

27.

A push down automaton with only symbol allowed on the stack along with fixed symbol.(a) Embedded PDA(b) Nested Stack automata(c) DPDA(d) Counter AutomatonI got this question in my homework.Question is from PDA-Acceptance by Final State topic in chapter Push Down Automata of Automata Theory

Answer»

Correct answer is (d) Counter Automaton

Easy explanation: This CLASS of AUTOMATA can recognize a set of CONTEXT FREE languages like {anbn|n belongs to N}

28.

The class of languagesnot accepted by non deterministic, nonerasing stack automata is _______(a) NSPACE(n2)(b) NL(c) CSL(d) All of the mentionedI had been asked this question by my college director while I was bunking the class.My doubt stems from PDA-Acceptance by Final State topic in chapter Push Down Automata of Automata Theory

Answer»

Correct choice is (d) All of the mentioned

For EXPLANATION I would say: NSPACE or NON DETERMINISTIC space is the COMPUTATIONAL resource describing the memory space for a non deterministic TURING machine.

29.

abb*c denotes which of the following?(a) {abnc|n=0}(b) {abnc|n=1}(c) {anbc|n=0}(d) {abcn|n>0}I have been asked this question by my college director while I was bunking the class.This is a very interesting question from Regular Languages and D-PDA topic in section Push Down Automata of Automata Theory

Answer»

Right answer is (b) {abnc|n=1}

Easy explanation: Here, the FIRST mentioned b is FIXED while the other can be ZERO or can be repeated any number of TIME.

30.

Which of the following is a simulator for non deterministic automata?(a) JFLAP(b) Gedit(c) FAUTO(d) None of the mentionedThis question was addressed to me in a job interview.Origin of the question is Deterministic PDA topic in chapter Push Down Automata of Automata Theory

Answer» CORRECT answer is (a) JFLAP

The best explanation: JFLAP is a software for EXPERIMENTING with FORMAL TOPICS including NFA, NPDA, multi-tape TURING machines and L-systems.
31.

A language accepted by Deterministic Push down automata is closed under which of the following?(a) Complement(b) Union(c) Both (a) and (b)(d) None of the mentionedThe question was posed to me during a job interview.This intriguing question originated from Deterministic PDA in portion Push Down Automata of Automata Theory

Answer»

The correct choice is (a) Complement

Easiest explanation: Deterministic CONTEXT free LANGUAGES(one accepted by PDA by FINAL state), are drastically different from the context free languages. For example they are closed under COMPLEMENTATION and not union.

32.

Which of the following automata takes queue as an auxiliary storage?(a) Finite automata(b) Push down automata(c) Turing machine(d) All of the mentionedThe question was asked in an international level competition.Asked question is from PDA-acceptance by Empty Stack topic in division Push Down Automata of Automata Theory

Answer»

Right option is (c) Turing machine

Explanation: Pushdown Automaton USES stack as an AUXILIARY storage for its operations. Turing machines USE Queue for the same.

33.

State true or false:Statement: Every context free grammar can be transformed into an equvalent non deterministic push down automata.(a) Statement: Every context free grammar can be transformed into an equvalent non deterministic push down automata.(b) true(c) falseI had been asked this question in class test.My query is from From PDA to Grammars in section Push Down Automata of Automata Theory

Answer»

The correct option is (a) Statement: EVERY context free GRAMMAR can be TRANSFORMED into an equvalent non deterministic push down automata.

Explanation: Push down automata is the automaton machine for all the context free grammar or Type 2 languages.

34.

Which of the following assertion is false?(a) If L is a language accepted by PDA1 by final state, there exist a PDA2 that accepts L by empty stack i.e. L=L(PDA1)=L(PDA2)(b) If L is a CFL then there exists a push down automata P accepting CF; ; by empty stack i.e. L=M(P)(c) Let L is a language accepted by PDA1 then there exist a CFG X such that L(X)=M(P)(d) All of the mentionedThe question was posed to me during a job interview.This intriguing question originated from From PDA to Grammars topic in portion Push Down Automata of Automata Theory

Answer»

Right option is (d) All of the MENTIONED

To EXPLAIN: All the assertions mentioned are THEOREMS or COROLLARY.

35.

The instantaneous PDA is has the following elements(a) State(b) Unconsumed input(c) Stack content(d) All of the mentionedI had been asked this question during an interview.My enquiry is from From PDA to Grammars in division Push Down Automata of Automata Theory

Answer»

The correct option is (d) All of the mentioned

The explanation: The instantaneous description of a PDA is represented by 3 tuple:

(q,w,s)

where q is the STATE, w is the unconsumed input and s is the stack content.

36.

Which of the following relates to Chomsky hierarchy?(a) Regular

Answer» CORRECT choice is (a) Regular
To elaborate: The chomsky HIERARCHY lays down the FOLLOWING ORDER: Regular
37.

State true or false:Statement: Counter Automaton can exist for the language L={0^i1^i|i>=0}(a) Statement: Counter Automaton can exist for the language L={0^i1^i|i>=0}(b) true(c) falseThe question was posed to me in final exam.This interesting question is from From Grammars to Push Down Automata topic in division Push Down Automata of Automata Theory

Answer»

The correct answer is (a) Statement: Counter Automaton can exist for the language L={0^i1^i|i>=0}

The EXPLANATION: The PDA works as follows. Instead of saving excess 0’s or 1’s on the stack, we save *’s and use two different states to indicate which symbol there is currently a SURPLUS of. The STATE q0 is the initial state and the only accepting state.

38.

Which of the following automata takes stack as auxiliary storage?(a) Finite automata(b) Push down automata(c) Turing machine(d) All of the mentionedI have been asked this question in a national level competition.I want to ask this question from PDA-acceptance by Empty Stack in portion Push Down Automata of Automata Theory

Answer» RIGHT choice is (b) PUSH down automata

For explanation: Pushdown AUTOMATON uses stack as an auxiliary storage for its operations. Turing machines USE QUEUE for the same.
39.

A push down automatacan represented using:(a) Transition graph(b) Transition table(c) ID(d) All of the mentionedThe question was asked during an online exam.I would like to ask this question from From PDA to Grammars in division Push Down Automata of Automata Theory

Answer»

The correct choice is (d) All of the mentioned

The explanation is: Yes, a PDA can be REPRESENTED USING a TRANSITION DIAGRAM, transition table and an instantaneous DESCRIPTION.

40.

Which of the following can be accepted by a DPDA?(a) The set of even length palindrome over {a,b}(b) The set of odd length palindrome over {a,b}(c) {xx^c| where c stands for the complement,{0,1}}(d) None of the mentionedThe question was posed to me during an interview.My enquiry is from From Grammars to Push Down Automata in section Push Down Automata of Automata Theory

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

Explanation: THEOREM: The language PAL of palindromes over the ALPHABET {0,1} cannot be ACCEPTED by any finite automaton , and it is therefore not regular.
41.

A context free grammar can be recognized by(a) Push down automata(b) 2 way linearly bounded automata(c) Both (a) and (b)(d) None of the mentionedThis question was addressed to me by my college professor while I was bunking the class.Enquiry is from PDA-acceptance by Empty Stack in division Push Down Automata of Automata Theory

Answer»

Correct answer is (C) Both (a) and (b)

Easiest explanation: A linearly bounded AUTOMATA is a restricted non deterministic turing MACHINE which is capable of accepting ant CONTEXT free grammar.

42.

A context free grammar is a ___________(a) English grammar(b) Regular grammar(c) Context sensitive grammar(d) None of the mentionedThis question was addressed to me in an online interview.This is a very interesting question from PDA-acceptance by Empty Stack in division Push Down Automata of Automata Theory

Answer» CORRECT CHOICE is (c) Context SENSITIVE grammar

Explanation: Context free grammar is the set which BELONGS to the set of context free grammar. Similarly, Regular grammar is a set which belongs to the the set of Context free grammar.
43.

The language L ={a^i2b^i|i>=0} is:(a) recursive(b) deterministic CFL(c) regular(d) Two of the mentioned is correctThe question was posed to me by my college director while I was bunking the class.The query is from DPDA and Ambiguous Grammars topic in portion Push Down Automata of Automata Theory

Answer»

Correct CHOICE is (d) Two of the MENTIONED is correct

Explanation: The LANGUAGE is recursive and every recursive language is a CFL.

44.

Which of the following are the actions that operates on stack top?(a) Pushing(b) Popping(c) Replacing(d) All of the mentionedThe question was posed to me in examination.The doubt is from From PDA to Grammars in portion Push Down Automata of Automata Theory

Answer» RIGHT OPTION is (d) All of the mentioned

Easy explanation: Push, pop and replace are all the basic and only OPERATIONS that TAKES place on stack top.
45.

If the PDA does not stop on an accepting state and the stack is not empty, the string is:(a) rejected(b) goes into loop forever(c) both (a) and (b)(d) none of the mentionedThe question was asked by my school principal while I was bunking the class.The query is from Deterministic PDA topic in portion Push Down Automata of Automata Theory

Answer»

The correct answer is (a) rejected

To explain: To accept a string, PDA NEEDS to HALT at an ACCEPTING state and with a STACK EMPTY, else it is called rejected. Given a PDA M, we can construct a PDA M’ that accepts the same language as M, by both acceptance criteria.

46.

Which of the following are non essential while simplifying a grammar?(a) Removal of useless symbols(b) Removal of unit productions(c) Removal of null production(d) None of the mentionedThis question was addressed to me by my college director while I was bunking the class.Origin of the question is DPDA and Ambiguous Grammars in section Push Down Automata of Automata Theory

Answer»

Right CHOICE is (d) None of the mentioned

Explanation: Here are some process used to simplify a CFG but to produce an equivalent grammar:

a) REMOVAL of useless symbols(non TERMINAL) b) Removal of Unit productions and C) Removal of Null productions.

47.

Which of the operations are eligible in PDA?(a) Push(b) Delete(c) Insert(d) PopThe question was asked by my school principal while I was bunking the class.The query is from PDA-Acceptance by Final State topic in section Push Down Automata of Automata Theory

Answer»

The correct option is (a, d)

The EXPLANATION: PUSH and pop are the OPERATIONS we perform to operate a stack. A stack follows the LIFO principle, which states its RULE as: Last In First Out.

48.

Which among the following is incorrect with reference to a derivation tree?(a) Every vertex has a label which is a terminal or a variable.(b) The root has a label which can be a terminal.(c) The label of the internal vertex is a variable.(d) None of the mentionedI got this question in an online interview.My question is from DPDA and Ambiguous Grammars in portion Push Down Automata of Automata Theory

Answer» RIGHT choice is (b) The ROOT has a label which can be a terminal.

To ELABORATE: The root or interms of the grammar, STARTING VARIABLE can not be a terminal.
49.

State true or false:S-> 0S1|01(a) S-> 0S1|01(b) Statement: No regular expression exists for the given grammar.(c) true(d) falseI had been asked this question in quiz.Asked question is from DPDA and Ambiguous Grammars in division Push Down Automata of Automata Theory

Answer» CORRECT option is (a) S-> 0S1|01

For explanation I would SAY: The grammar generates a LANGUAGE L such that L={0^n1^n|n>=1} which is not regular. Thus, no regular expression exists for the same.
50.

If two sets, R and T has no elements in common i.e. RÇT=Æ, then the sets are called(a) Complement(b) Union(c) Disjoint(d) ConnectedI got this question in semester exam.My question is based upon PDA-acceptance by Empty Stack topic in portion Push Down Automata of Automata Theory

Answer»

Right OPTION is (c) DISJOINT

Easiest explanation: TWO sets are CALLED disjoint if they have no elements in common i.e.RÇT=Æ.