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.

151.

The grammar A → AA | (A) | e is not suitable for predictive-parsing because the grammar is?(a) Ambiguous(b) Left recursive(c) Right recursive(d) An operator grammar

Answer» Correct choice is (b) Left recursive

For explanation I would say: A ::= A a

    | b  is the left recursive language.
152.

Output file of Lex is __________ the input file is Myfile.(a) Myfile.e(b) Myfile.yy.c(c) Myfile.lex(d) Myfile.obj

Answer» Right option is (b) Myfile.yy.c

For explanation: This Produce the filr “myfile.yy.c” which we can then compile with g++.
153.

Which of the following describes a handle (as applicable to LR-parsing) appropriately?(a) Position where  next reduce or  shift  operation will occur(b) The next step has use of Non-terminal for reduction(c) Used for reduction in a coming-up  step along with a position in the sentential form where the next shift or reduce operation will occur(d) Used in the next step for reduction along with a position in the sentential form where the right hand side of the production may be found

Answer» Correct answer is (d) Used in the next step for reduction along with a position in the sentential form where the right hand side of the production may be found

For explanation I would say: the next step in LR parsing shall have a Reduction.
154.

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 analyzer

Answer» The correct answer is (a) The code generator

Explanation: Lexical analysis is the process of converting a sequence of characters into a sequence of tokens.
155.

From where it takes its input from?(a) Lexical analyser(b) Syntactic Analyser(c) Semantic Analyser(d) None of the mentioned

Answer» Right choice is (a) Lexical analyser

The explanation: A syntax analyzer or parser takes the input from a lexical analyzer in the form of token streams.
156.

Consider the grammar given below E? E+E | E*E | E-E | E/E | E^E | (E) | id Assume that + and ^ have the same but least precedence, * and / have the next higher precedence but the same precedence and finally ^ has the highest precedence. Assume + and ^ associate to the left like * and / and that ^ associates to the right. Choose the correct for the ordered pairs (^,^), (-,-), (+,+), (*,*) in the operator precedence table constructed for the grammar.(a) All (c) < >, =(d) < > > >

Answer» The correct answer is (d) < > > >

Easiest explanation: This relation is established of basis of the precedence of operators.
157.

In which addressing mode the operand is given explicitly in the instruction?(a) Absolute mode(b) Immediate mode(c) Indirect mode(d) Index mode

Answer» Right answer is (b) Immediate mode

Easiest explanation: In Immediate addressing mode operand is directly found from the instruction.