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.

Which table is a permanent database that has an entry for each terminal symbol?(a) Terminal Table(b) Literal Table(c) Identifier Table(d) None of the mentionedI got this question during an interview.My query is from Syntax-Directed Definitions and Translations in portion Syntax Directed Definition and Translations of Compiler

Answer»

The correct choice is (a) Terminal Table

The BEST I can EXPLAIN: A 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 statement for(;;) is perfectly valid C statement.(a) True(b) FalseThe question was asked during a job interview.My question comes from Switch Case topic in portion Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT OPTION is (B) False

Explanation: INFINITE LOOP.

53.

Daisy chain is a device for ___________(a) None of the mentioned(b) Connecting devices to a controller(c) Connectingcontroller to devices(d) All of the mentionedThe question was posed to me during an interview for a job.Enquiry is from SDT Schemes to Specify Translation of various Programming Language Construct topic in division Syntax Directed Definition and Translations of Compiler

Answer»

Right choice is (B) CONNECTING devices to a controller

Easy EXPLANATION: COMBINES multiple devices in sequence or a ring.

54.

Which of the following is a two-dimensional array?(a) array array[20][20](b) int array[20][20](c) int array[20, 20](d) char array[20]The question was asked during an interview for a job.The doubt is from Array Reference topic in division Syntax Directed Definition and Translations of Compiler

Answer»

The correct OPTION is (B) int array[20][20]

The explanation: Double dimensional ARRAYS are declared in this format.

55.

Which of the following operators has the highest precedence?(a) Unary +(b) *(c) >=(d) ==The question was posed to me during an online interview.My doubt is from Implementation of Increment and Decrement topic in division Syntax Directed Definition and Translations of Compiler

Answer» CORRECT OPTION is (a) UNARY +

To EXPLAIN: Unary operators have max precedence in over all other arithmetic operators.
56.

Which of the following type of software should be used if you need to create, edit and print documents?(a) Word processing(b) Spreadsheet(c) Desktop publishing(d) UNIXThe question was asked in an interview for job.This question is from Three-Address Statements topic in portion Syntax Directed Definition and Translations of Compiler

Answer» CORRECT ANSWER is (a) Word processing

The best explanation: APPLICATION SOFTWARE such as word PROCESSORS.
57.

Producer consumer problem can be solved using __________(a) Semaphores(b) Event counters(c) Monitors(d) All of the mentionedThis question was addressed to me during an online interview.This intriguing question originated from SDT Schemes to Specify Translation of various Programming Language Construct topic in section Syntax Directed Definition and Translations of Compiler

Answer»

The correct CHOICE is (d) All of the mentioned

To elaborate: The famous producer CONSUMER problem can be solved by a SEMAPHORES event counters as WELL as monitors.

58.

The best way to compare the different implementations of symbol table is to compare the time required to ____________(a) Add a new name(b) Make an enquiry(c) Add a new name and make an enquiry(d) All of the mentionedThis question was posed to me in an interview for internship.My question is from Implementation of the Translation Specified by Syntax-Directed Definitions in chapter Syntax Directed Definition and Translations of Compiler

Answer»

Right ANSWER is (d) All of the MENTIONED

The EXPLANATION: These are the DIFFERENT implementations of the symbol table as mentioned above.

59.

Which is not true about syntax and semantic parts of a computer language?(a) Semantics is checked mechanically by a computer(b) Semantics is the responsibility of the programmer(c) All of the mentioned(d) None of the mentionedI have been asked this question in final exam.Asked question is from Implementation of the Translation Specified by Syntax-Directed Definitions topic in section Syntax Directed Definition and Translations of Compiler

Answer»

Correct option is (d) None of the mentioned

Explanation: Both in TERMS of SEMANTICS is not TRUE.

60.

Pass I ______________(a) Assign address to all statements(b) Save the values assigned to all labels for use in pass 2(c) Perform some processing(d) All of the mentionedThe question was posed to me during an internship interview.I'm obligated to ask this question of Syntax-Directed Definitions and Translations topic in portion Syntax Directed Definition and Translations of Compiler

Answer»

The correct option is (d) All of the MENTIONED

Easiest EXPLANATION: The pass 1 of a compiler the above mentioned FUNCTIONS are performed

61.

Which of the following is true for machine language?(a) Continuous execution of program segments(b) Depicting flow of data in a system(c) A sequence of instructions which solves a problem(d) The language which interacts with the computer using only the binary digits 1 and 0This question was posed to me during an online interview.I would like to ask this question from Syntax-Directed Definitions and Translations in division Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT option is (d) The language which interacts with the computer using only the BINARY digits 1 and 0

To explain: Machine code or machine language is a set of INSTRUCTIONS executed directly by a computer’s central processing UNIT (CPU). Each instruction performs a very specific task.

62.

If the programming language uses static scoping and call by need parameter passing mechanism, the values printed will be?(a) 115, 220(b) 25, 220(c) 25, 15(d) 115, 105I got this question in quiz.The doubt is from L-Attributed Definition topic in section Syntax Directed Definition and Translations of Compiler

Answer»

Correct option is (d) 115, 105

The best I can explain: So i = 100 & j = 5 P (i + j) = P (100 + 5) = P(105) So x = 105 x + 10 = 105 + 10 = 115 So 115 & 105 will be PRINTED.

63.

Which of the following statements is FALSE?(a) In up-typed languages, values do not have any types & Dynamic languages have no variables types(b) In up-typed languages, values do not have any types(c) Dynamic languages have no variables types(d) None of the mentionedI had been asked this question in a national level competition.This intriguing question originated from L-Attributed Definition in chapter Syntax Directed Definition and Translations of Compiler

Answer» RIGHT choice is (C) Dynamic LANGUAGES have no VARIABLES types

The BEST I can explain: They have dynamically changing types.
64.

The process manager has to keep track of ___________(a) Status of each program(b) Information to a programmer using the system(c) Status of each program & Information to a programmer using the system(d) None of the mentionedI got this question in an interview.This intriguing question originated from Syntax-Directed Definitions and Translations topic in division Syntax Directed Definition and Translations of Compiler

Answer»

Right OPTION is (c) Status of each PROGRAM & Information to a programmer USING the system

The best explanation: Process MANAGER keep track of the status and info about the program.

65.

Which of the following features cannot be captured by CFG?(a) Syntax of if-then-else statements(b) Syntax of recursive procedures(c) A variable is declared before its use(d) Matching nested parenthesisI had been asked this question in examination.This interesting question is from Implementation of the Translation Specified by Syntax-Directed Definitions in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT answer is (d) Matching nested parenthesis

Best explanation: It is because, it is equivalent to RECOGNIZING US, where the first w is the DECLARATION and the second is its USE, we are not a CFG.

66.

What is the input of Lex?(a) Set to regular expression(b) Statement(c) Numeric data(d) ASCII dataThe question was asked in quiz.The query is from SDT Schemes to Specify Translation of various Programming Language Construct in portion Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT option is (a) Set to REGULAR expression

Best explanation: INPUT is a STRING.

67.

The method which merges the bodies of two loops is?(a) Loop rolling(b) Loop jamming(c) Constant folding(d) None of the mentionedThis question was posed to me in quiz.The question is from Syntax-Directed Definitions and Translations topic in portion Syntax Directed Definition and Translations of Compiler

Answer»

The correct choice is (b) LOOP jamming

Explanation: In COMPUTER science, loop fusion (or loop jamming) is a compiler optimization and loop transformation which replaces multiple loops with a single ONE.

68.

An if statement may contain compound statements only in the else clause.(a) True(b) FalseThis question was addressed to me in a job interview.My query is from Switch Case topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

Correct answer is (B) False

Best explanation: If can ALSO have compound statements.

69.

Array passed as an argument to a function is interpreted as ______________(a) Address of the array(b) None of the mentioned(c) Base address(d) No. of elements of the arrayI have been asked this question in an online interview.My doubt is from Array Reference in section Syntax Directed Definition and Translations of Compiler

Answer»

The correct choice is (C) Base address

To ELABORATE: The base address is passed when the ARRAY is passed as an ARGUMENT in a FUNCTION.

70.

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 analysisThe question was asked by my school principal while I was bunking the class.I need to ask this question from Three-Address Statements topic in chapter Syntax Directed Definition and Translations of Compiler

Answer» RIGHT answer is (B) LEXICAL analysis

Easy explanation: CHECKS for CORRECT syntax.
71.

Which of the following operators takes only integer operands?(a) +(b) *(c) /(d) %I had been asked this question in examination.This is a very interesting question from Implementation of Increment and Decrement in portion Syntax Directed Definition and Translations of Compiler

Answer»

The correct ANSWER is (d) %

To EXPLAIN: Two integers are TAKEN to be INPUT.

72.

Dynamic linking can cause security concerns because ______________(a) Security is dynamic(b) None of the mentioned(c) Security is dynamic & Cryptographic procedures are not available for dynamic linking(d) Cryptographic procedures are not available for dynamic linkingThis question was posed to me in a job interview.This is a very interesting question from L-Attributed Definition in section Syntax Directed Definition and Translations of Compiler

Answer»

The correct OPTION is (d) CRYPTOGRAPHIC PROCEDURES are not available for dynamic linking

Explanation: Required by the PROGRAM are linked during RUN time.

73.

Generation of intermediate code based on a abstract machine model is useful in compilers because ____________(a) Implementation of lexical analysis and syntax analysis is made easier(b) Writing for intermediate code generation(c) Portability of the front end of the compiler(d) None of the mentionedThis question was posed to me during a job interview.Origin of the question is Implementation of the Translation Specified by Syntax-Directed Definitions in division Syntax Directed Definition and Translations of Compiler

Answer»

Right option is (a) Implementation of lexical ANALYSIS and syntax analysis is made easier

For EXPLANATION I would say: Intermediate code GENERATOR receives input from its predecessor phase, SEMANTIC analyzer, in the form of an annotated syntax tree.

74.

The specific task storage manager performs ____________(a) Allocation/ deal location of programs(b) Protection of storage area assigned to the program(c) Allocation/ deal location of programs & protection of storage area assigned to the program(d) None of the mentionedI got this question during an online interview.The origin of the question is Implementation of the Translation Specified by Syntax-Directed Definitions topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT option is (c) ALLOCATION/ DEAL location of programs & protection of storage AREA assigned to the program

Explanation: Its BASIC function is that of the task storage manager.

75.

The root directory of a disk should be placed ___________(a) At a fixed address in main memory(b) At a fixed location on the disk(c) Anywhere on the disk(d) None of the mentionedThis question was posed to me in quiz.I'm obligated to ask this question of Syntax-Directed Definitions and Translations in portion Syntax Directed Definition and Translations of Compiler

Answer» RIGHT choice is (B) At a fixed location on the DISK

The BEST explanation: Root directory is PLACED at a fixed disk loc
76.

A Compiler has __________ phases.(a) 7(b) 6(c) 8(d) None of the mentionedThis question was posed to me by my school teacher while I was bunking the class.Query is from SDT Schemes to Specify Translation of various Programming Language Construct topic in division Syntax Directed Definition and Translations of Compiler

Answer» RIGHT choice is (c) 8

For EXPLANATION I would SAY: It has 8 phases.
77.

What is linker?(a) Is same as the loader(b) Create a load module(c) Is same as the loader & Create a load module(d) None of the mentionedThe question was asked in my homework.Query is from SDT Schemes to Specify Translation of various Programming Language Construct in chapter Syntax Directed Definition and Translations of Compiler

Answer»

Right answer is (B) Create a load module

Easy EXPLANATION: It creates a module to be LOADED.

78.

Which of the following is not a feature of the compiler?(a) Convertsit into machine code(b) None of the mentioned(c) Slow for debugging(d) Execution time is moreThis question was addressed to me in semester exam.My question is taken from SDT Schemes to Specify Translation of various Programming Language Construct in section Syntax Directed Definition and Translations of Compiler

Answer»

Right ANSWER is (d) Execution time is more

To EXPLAIN I WOULD SAY: No specified execution time.

79.

What is the function of the syntax phase?(a) recognize the language and to cal the appropriate action routines that will generate the intermediate form or matrix for these constructs(b) Build a literal table and an identifier table(c) Build a uniform symbol table(d) Parse the source program into the basic elements or tokens of the languageThis question was addressed to me by my college professor while I was bunking the class.My question is based upon Syntax-Directed Definitions and Translations in portion Syntax Directed Definition and Translations of Compiler

Answer»

Correct answer is (a) recognize the language and to cal the appropriate action ROUTINES that will GENERATE the intermediate FORM or matrix for these constructs

Easiest explanation: In this phase symbol table is created by the COMPILER which contains the list of lexemes or TOKENS.

80.

What is the index number of the last element of an array with 29 elements?(a) 29(b) 28(c) 0(d) Programmer-DefinedI have been asked this question in unit test.I'm obligated to ask this question of Array Reference in section Syntax Directed Definition and Translations of Compiler

Answer»

The correct answer is (b) 28

The best explanation: The indexing in an ARRAY STARTS with zero hence we can SAY that the ELEMENT.

81.

Pick the operators that associate from the right.(a) ?:(b) +=(c) =(d) All of the mentionedThis question was posed to me in semester exam.Asked question is from Implementation of Increment and Decrement in chapter Syntax Directed Definition and Translations of Compiler

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

To ELABORATE: EXPLANATION: They are right ASSOCIATIVE.
82.

Choose the correct statement.(a) Expressions evaluated at compile time(b) String constants concatenated at compile time(c) None of the mentioned(d) Both of the mentionedThe question was posed to me in exam.My question is taken from Implementation of Increment and Decrement topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT ANSWER is (d) Both of the mentioned

Easiest EXPLANATION: The STATEMENTS are TRUE.

83.

Non modifiable procedures are called ___________(a) Concurrent procedures(b) Serially usable procedures(c) Re-entrant procedures(d) Top down proceduresI got this question in an international level competition.My query is from SDT Schemes to Specify Translation of various Programming Language Construct in section Syntax Directed Definition and Translations of Compiler

Answer» CORRECT answer is (b) Serially usable procedures

To ELABORATE: These can’t be MODIFIED.
84.

Predictive parsers can be __________(a) Recursive(b) Constructive(c) Non recursive(d) Both Recursive and ConstructiveI had been asked this question during an online interview.This key question is from SDT Schemes to Specify Translation of various Programming Language Construct topic in section Syntax Directed Definition and Translations of Compiler

Answer»

Right OPTION is (a) Recursive

The explanation: The nature of PREDICTIVE PARSERS can be Recursive.

85.

Type checking is normally done during ____________(a) Lexical analysis(b) Syntax analysis(c) Syntax directed translation(d) Code generationThe question was asked in an interview for job.The doubt is from Three-Address Statements topic in division Syntax Directed Definition and Translations of Compiler

Answer»

Right OPTION is (c) Syntax directed translation

To ELABORATE: It enables the COMPILER to do TYPE checking.

86.

Consider the grammar rule. E -> E1 − E2 for arithmetic expressions. If E1 and E2 do not have any common sub expression, in order to get the shortest possible code.(a) E1 should be evaluated first(b) E2 should be evaluated first(c) Evaluation of E1 and E2 should necessarily be interleaved(d) Order of evaluation of E1 and E2 is of no consequenceI have been asked this question in an online interview.My question is from L-Attributed Definition topic in portion Syntax Directed Definition and Translations of Compiler

Answer» CORRECT option is (b) E2 should be evaluated first

The explanation: E1 is to be KEPT in accumulator & accumulator is REQUIRED for OPERATIONS to EVALUATE E2.
87.

A relocatable program form is one which?(a) Cannot execute in any area of storage other than the one designated(b) Consists of a program andinformation for its relocation(c) None of the mentioned(d) All of the mentionedI got this question in an online interview.Enquiry is from Implementation of the Translation Specified by Syntax-Directed Definitions topic in section Syntax Directed Definition and Translations of Compiler

Answer»

Correct option is (c) None of the mentioned

Best explanation: A relocatable PROGRAM form is one which CONSISTS of a program and relevant information for its relocation. USING this information it is possible to relocate the program to execute from a storage area then the one DESIGNATED for it at the time of its coding or translation.

88.

Dividing a project into segments and smaller units in order to simplify design and programming efforts is called?(a) Modular approach(b) Top down approach(c) Bottom up approach(d) Left right approachThe question was asked during an interview for a job.The question is from Syntax-Directed Definitions and Translations topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The correct option is (a) Modular APPROACH

The best I can explain: Modular design, or “modularity in design”, is a design approach that subdivides a system into smaller parts CALLED modules or skids that can be INDEPENDENTLY CREATED and then used in different SYSTEMS.

89.

Which of the following statement is true?(a) SLR powerful than LALR(b) LALRpowerful than Canonical LR parser(c) Canonical LRpowerful than LALR parser(d) The parsers SLR= Canonical LR=LALRThis question was posed to me in examination.I need to ask this question from Implementation of the Translation Specified by Syntax-Directed Definitions topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The correct answer is (c) Canonical LRpowerful than LALR PARSER

Best explanation: LR > LALR > SLR In TERMS of the parser.

90.

What is Pass 2?(a) Assemble instruction and generate data(b) Perform processing of assembler(c) Write the object program(d) All of the mentionedThe question was posed to me during an online exam.Query is from Syntax-Directed Definitions and Translations in portion Syntax Directed Definition and Translations of Compiler

Answer»

Correct choice is (d) All of the mentioned

For explanation: A multi-pass COMPILER is a type of compiler that processes the source CODE or abstract SYNTAX TREE of a program several times. Each pass takes the result of the previous pass as the input and creates an intermediate output.

91.

In C programming language, which of the following type of operators have the highest precedence?(a) Relational Operators(b) Equality Operators(c) Logical Operators(d) Arithmetic OperatorsI had been asked this question by my college professor while I was bunking the class.This intriguing question comes from Implementation of Increment and Decrement topic in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT answer is (d) Arithmetic Operators

Explanation: No other OPERATOR HASHIGHER PRECEDENCE than arithmetic operator.

92.

Yacc semantic action is a sequence of ___________(a) Tokens(b) Expression(c) Statement(d) RulesI have been asked this question in an online interview.My doubt stems from SDT Schemes to Specify Translation of various Programming Language Construct topic in portion Syntax Directed Definition and Translations of Compiler

Answer» CORRECT OPTION is (c) Statement

Explanation: YACC is yet ANOTHER compiler which is a set of statements.
93.

In a two pass assembler the object code generation is done during the __________(a) Second pass(b) First pass(c) Zeroth pass(d) Not done by assemblerThis question was addressed to me by my college director while I was bunking the class.The question is from SDT Schemes to Specify Translation of various Programming Language Construct in chapter Syntax Directed Definition and Translations of Compiler

Answer» RIGHT option is (a) Second PASS

The explanation is: I second pass object code is GENERATED.
94.

What is the task of the lexical analysis?(a) None of the mentioned(b) To build a literal and identifier table(c) To build a uniform symbol table(d) To build a uniform symbol table, literal and identifier tableI had been asked this question at a job interview.My query is from Three-Address Statements in chapter Syntax Directed Definition and Translations of Compiler

Answer»

Correct option is (d) To build a UNIFORM SYMBOL table, literal and identifier table

Easiest explanation: It is the task PERFORMED.

95.

Some code optimizations are carried out on the intermediate code because _______________(a) They enhance the portability of the complier to other target processors(b) Program analysis is name accurate on intermediate code than on machine code(c) The information from data flow analysis cannot otherwise be used for optimization(d) The information from the front end cannot otherwise be used for optimizationThis question was addressed to me in class test.I would like to ask this question from Intermediate Code-Generation topic in chapter Syntax Directed Definition and Translations of Compiler

Answer» RIGHT option is (b) PROGRAM ANALYSIS is name accurate on intermediate CODE than on machine code

Easiest explanation: Code optimizations are carried out on the intermediate code because program analysis is more accurate on intermediate code than on machine code.
96.

Which one of the following is true about the action of yacc for the given grammar?(a) It detects recursion and eliminates recursion(b) It detects reduce-reduce conflict and resolves(c) It detects shift-reduce conflict and resolves the conflict in favor of a shift over a reduce action(d) It detects shift-reduce conflict and resolves the conflict in favor of a reduce over a shift actionI got this question during a job interview.I need to ask this question from L-Attributed Definition in portion Syntax Directed Definition and Translations of Compiler

Answer»

Right option is (c) It DETECTS SHIFT-reduce conflict and resolves the conflict in favor of a shift over a reduce action

The best I can explain: Yacc tool is USED to create a LALR(1) PARSER.

97.

Ifdynamic scoping is used and call by name mechanism is used, the values printed will be?(a) 115, 220(b) 25, 220(c) 25, 15(d) 115, 105This question was addressed to me by my school teacher while I was bunking the class.I'd like to ask this question from L-Attributed Definition in section Syntax Directed Definition and Translations of Compiler

Answer»

Correct choice is (b) 25, 220

The best explanation: Since X = i + j & in P (x) i = 200 & j = 20 x = 200 + 20 = 220 & printing (x + 10) 9. = i + j + 10 = 10 + 5 + 10 = 25.

98.

In Lex, a class is complemented by first placing ____________(a) ^(b) OR(c) –(d) NOTThis question was posed to me in final exam.Asked question is from Three-Address Statements in chapter Syntax Directed Definition and Translations of Compiler

Answer» CORRECT ANSWER is (a) ^

EXPLANATION: ^ =COMPLEMENT.
99.

Default’ case is mandatory in a switch statement.(a) True(b) FalseThis question was addressed to me in an interview for internship.Enquiry is from Switch Case topic in portion Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT option is (B) False

The BEST I can explain: Default cases MAY or may not be written.

100.

What is the max no. of dimensions an array may have?(a) 2(b) 8(c) 20(d) No limitThis question was posed to me by my school teacher while I was bunking the class.This is a very interesting question from Array Reference in portion Syntax Directed Definition and Translations of Compiler

Answer»

Correct CHOICE is (d) No limit

Easy explanation: DIMENSION of an array can be any number.