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.

51.

What is terminal table?(a) Contains all constants in the program(b) Is a permanent table of decision rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure(c) Consist of a full or partial list of the token is as they appear in the program created by lexical analysis and used for syntax analysis and interpretation(d) Is a permanent table which lists all keywords and special symbols of the language in symbolic formThe question was asked during an interview for a job.This question is from LR Parser in portion Bottom Up Parsing of Compiler

Answer» RIGHT answer is (d) Is a permanent table which lists all KEYWORDS and special symbols of the language in symbolic form

The BEST explanation: A permanent database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc FIELDS: Name of the SYMBOL.
52.

The construction of the canonical collection of the sets of LR (1) items are similar to the construction of the canonical collection of the sets of LR (0) items. Which is an exception?(a) Closure and goto operations work a little bit different(b) Closure and goto operations work similarly(c) Closure and additive operations work a little bit different(d) Closure and associatively operations work a little bit differentThis question was posed to me in final exam.My question comes from LR Parser in chapter Bottom Up Parsing of Compiler

Answer»

The correct choice is (a) Closure and GOTO operations work a little BIT different

Explanation: Closure and goto do work DIFFERENTLY in case of LR (0) and LR (1).

53.

An intermediate code form is __________(a) Postfix notation(b) Syntax Trees(c) Three Address code(d) All of the mentionedI got this question at a job interview.This intriguing question comes from Handle of Right sentinel Grammar topic in division Bottom Up Parsing of Compiler

Answer»

Right choice is (d) All of the mentioned

To explain I would say: INTERMEDIATE CODE generator RECEIVES input from its predecessor phase, SEMANTIC analyzer, in the form of an annotated syntax TREE.

54.

The linker __________(a) Is similar to interpreter(b) Uses source code as its input(c) Is required to create a load module(d) None of the mentionedI have been asked this question in final exam.This key question is from Bottom-Up Parsing-2 topic in portion Bottom Up Parsing of Compiler

Answer»

Right option is (c) Is required to CREATE a load module

To explain I WOULD say: It is a program that takes one or more object FILES generated by a compiler and COMBINES them into a single executable file, LIBRARY file, or another object file.

55.

Scissoring enables __________(a) A part of data to be displayed(b) Entire data to be displayed(c) None of the mentioned(d) No data to be displayedI had been asked this question in unit test.My enquiry is from Bottom-Up Parsing-2 in portion Bottom Up Parsing of Compiler

Answer» CORRECT choice is (a) A PART of data to be displayed

The EXPLANATION is: DISPLAYS only some part of the data.
56.

A latch is constructed using which two cross coupled?(a) AND OR gates(b) AND gates(c) NAND and NOR gates(d) NAND gatesI had been asked this question in an international level competition.This is a very interesting question from Bottom-Up Parsing-2 topic in division Bottom Up Parsing of Compiler

Answer»

Correct option is (d) NAND gates

For EXPLANATION: It has two INPUTS and ONE output.

57.

The action of parsing the source program into proper syntactic classes is called __________(a) Syntax Analysis(b) Lexical Analysis(c) Interpretation analysis(d) General Syntax AnalysisI have been asked this question in an interview for internship.My question is taken from Bottom-Up Parsing-1 in division Bottom Up Parsing of Compiler

Answer» RIGHT answer is (b) LEXICAL Analysis

For EXPLANATION: Conversion of characters to TOKENS.
58.

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. Hence which one is true?(a) N1 is necessarily less than n2(b) N1 is necessarily equal to n2(c) N1 is necessarily greater than n2(d) None of the mentionedI have been asked this question during an interview for a job.My question comes from Handle of Right sentinel Grammar topic in division Bottom Up Parsing of Compiler

Answer»

Correct OPTION is (b) N1 is NECESSARILY EQUAL to n2

The explanation: The output of lexical analyzer is output token.

59.

In a bottom up evaluation of a syntax direction definition, inherited attributes can __________(a) Always be evaluated(b) Be evaluated only if the definition is L –attributed(c) Evaluation only done if the definition has synthesized attributes(d) None of the mentionedI got this question by my college director while I was bunking the class.I want to ask this question from Handle of Right sentinel Grammar in division Bottom Up Parsing of Compiler

Answer» CORRECT answer is (c) Evaluation only DONE if the DEFINITION has synthesized attributes

Explanation: Bottom-up PARSING identifies and processes the text’s lowest-level, before its mid-level structures, and the highest-level overall structure to last are left.
60.

A synthesized attribute is an attribute whose value at a parse tree node depends on __________(a) Attributes at the siblings only(b) Attributes at parent node only(c) Attributes at children nodes only(d) None of the mentionedThis question was posed to me during a job interview.My enquiry is from Handle of Right sentinel Grammar in portion Bottom Up Parsing of Compiler

Answer»

The correct OPTION is (c) ATTRIBUTES at children nodes only

Explanation: Synthesized attribute’s VALUE depend on children NODE only.

61.

Input to code generator is __________(a) Source code(b) Intermediate code(c) Target code(d) All of the mentionedI have been asked this question during a job interview.This is a very interesting question from Handle of Right sentinel Grammar topic in section Bottom Up Parsing of Compiler

Answer»

The correct answer is (B) INTERMEDIATE CODE

For explanation: Intermediate code is the input to the code GENERATOR.

62.

An optimizer Compiler __________(a) Is optimized to occupy less space(b) Is optimized to occupy less space & Optimize the code(c) Optimize the code(d) None of the mentionedI had been asked this question in an interview for job.This is a very interesting question from Bottom-Up Parsing-2 in portion Bottom Up Parsing of Compiler

Answer»

Right answer is (d) NONE of the mentioned

To EXPLAIN I would say: In computing, an OPTIMIZING compiler is a compiler that tries to minimize or maximize some ATTRIBUTES of an executable computer program.

63.

An optimizing compiler __________(a) Is optimized to occupy less space(b) Is optimized to take less time for execution(c) Optimized the code(d) None of the mentionedThis question was addressed to me in an online quiz.The origin of the question is Handle of Right sentinel Grammar topic in section Bottom Up Parsing of Compiler

Answer»

Right answer is (c) Optimized the CODE

The best I can explain: As the NAME suggests that it OPTIMIZES the code.

64.

When ß (in the LR(1) item A -> ß.a,a) is not empty, the look-head _________(a) Will be affecting(b) Does not have any affect(c) Shift will take place(d) Reduction will take placeI got this question in class test.Enquiry is from LR Parser topic in section Bottom Up Parsing of Compiler

Answer»

Correct CHOICE is (B) Does not have any affect

For explanation: There is no terminal before the NON terminal BETA.

65.

Shift reduce parsers are __________(a) Top down Parser(b) Bottom Up parser(c) May be top down or bottom up(d) None of the mentionedThis question was posed to me during an interview.Question is from Bottom-Up Parsing-2 in chapter Bottom Up Parsing of Compiler

Answer»

The CORRECT option is (b) BOTTOM Up PARSER

To ELABORATE: ALSO known as shift reduce parser.

66.

A grammar that produces more than one parse tree for some sentence is called __________(a) Ambiguous(b) Unambiguous(c) Regular(d) None of the mentionedI had been asked this question in an interview for job.Enquiry is from Bottom-Up Parsing-2 in chapter Bottom Up Parsing of Compiler

Answer» RIGHT choice is (a) Ambiguous

To elaborate: ambiguous GRAMMAR has more than ONE parse TREE.
67.

System program such as compiler are designed so that they are _________(a) Re-enterable(b) Non reusable(c) Serially usable(d) None of the mentionedThis question was addressed to me during an online interview.The origin of the question is LR Parser topic in chapter Bottom Up Parsing of Compiler

Answer»

Correct answer is (a) Re-enterable

To EXPLAIN I WOULD SAY: Re-enterable is the keyword for COMPILER being designed.

68.

Which of the following is incorrect for the actions of A LR-Parser I) shift s ii) reduce A->ß iii) Accept iv) reject?(a) Only I)(b) I) and ii)(c) I), ii) and iii)(d) I), ii) , iii) and iv)The question was posed to me during an online exam.I would like to ask this question from LR Parser in section Bottom Up Parsing of Compiler

Answer»

Right CHOICE is (c) I), ii) and III)

Explanation: Only reject out of the FOLLOWING is a correct LR PARSER action.

69.

An LR-parser can detect a syntactic error as soon as __________(a) The parsing starts(b) It is possible to do so a left-to-right scan of the input(c) It is possible to do so a right-to-left scan of the input(d) Parsing endsI have been asked this question during an online interview.Question is taken from LR Parser in chapter Bottom Up Parsing of Compiler

Answer»

The correct ANSWER is (b) It is POSSIBLE to do so a left-to-right scan of the input

Best explanation: Error is found when it the input STRING is scanned.

70.

Shift reduce parsers are __________(a) Top down parser(b) Bottom up parser(c) Maybe both(d) None of the mentionedThe question was asked by my school principal while I was bunking the class.Origin of the question is Handle of Right sentinel Grammar in chapter Bottom Up Parsing of Compiler

Answer»

The correct OPTION is (b) Bottom up parser

For explanation: This corresponds to starting at the LEAVES of the parse tree. It can be thought of a process of reducing the string in question to the START symbol of the grammar. Bottom-up parsing is ALSO known as shift-reduce parsing.

71.

Running time of a program depends on __________(a) Addressing mode(b) Order of computations(c) The usage of machine idioms(d) All of the mentionedThis question was addressed to me during an interview for a job.I want to ask this question from Bottom-Up Parsing-1 in division Bottom Up Parsing of Compiler

Answer»

Correct option is (d) All of the mentioned

Explanation: Run time, RUNTIME or EXECUTION time is the time during which a PROGRAM is running (executing).

72.

Which of the following actions an operator precedence parser may take to recover from an error?(a) Insert symbols onto the stack(b) Delete symbols from the stack(c) Inserting or deleting symbols from the input(d) All of the mentionedI got this question during an interview.Query is from Handle of Right sentinel Grammar in section Bottom Up Parsing of Compiler

Answer»

Correct option is (d) All of the mentioned

The EXPLANATION: All these SYMBOLS are used to RECOVER operator precedence parser from an ERROR.

73.

In an absolute loading scheme which loader function is accomplished by assembler?(a) Re-allocation(b) Allocation(c) Linking(d) LoadingThis question was addressed to me in examination.Question is from Bottom-Up Parsing-1 topic in chapter Bottom Up Parsing of Compiler

Answer»

The CORRECT CHOICE is (a) Re-allocation

The BEST I can explain: Large NUMBER variables onto a small number of CPU register.

74.

A bottom up parser generates __________(a) Right most derivation(b) Right most derivation in reverse(c) Left most derivation(d) Left most derivation in reverseThis question was addressed to me in a job interview.The question is from Handle of Right sentinel Grammar topic in division Bottom Up Parsing of Compiler

Answer»

Correct answer is (B) Right most derivation in reverse

The best explanation: This corresponds to starting at the leaves of the parse tree. It can be thought of. A process of REDUCING the string in question to the START symbol of the grammar. Bottom-up PARSING is also known as shift-reduce parsing.