Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Multiple choice question for engineering

Set 1

1. The symbol table implementation is based on the property of locality of reference is
a) Linear List
b) Search Tree
c) Hash table
d) Self Organization

View Answer

Answer: c [Reason:] A hash table (hash map) is a data structure used to implement an associative array. A hash table uses a hash function to compute an index into an array, from which the correct value can be found.

2. In operator precedence parsing whose precedence relations are defined
a) For all pair of non-terminals
b) For all pair of terminals
c) To delimit the handle
d) None of the mentioned

View Answer

Answer: a [Reason:] There are two important properties for these operator precedence parsers is that it does not appear on the right side of any production and no production has two adjacent no terminals.

3. LR parsers are attractive because
a) It can be constructed to recognize CFG corresponding to almost all programming constructs
b) It does not backtrack
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: c [Reason:] These above mentioned are the reasons why LR parser is considered to be attractive

4. The most powerful parser is
a) SLR
b) LALR
c) Canonical LR
d) Operator Precedence

View Answer

Answer: c [Reason:] The most powerful parser is Canonical LR

5. Yacc Builds up
a) SLR parsing Table
b) Canonical LR parsing Table
c) LALR parsing Table
d) None of the mentioned

View Answer

Answer: c [Reason:] Yacc provides a general tool for describing the input to a computer program.

6. Object program is a
a) Program written in machine language
b) Translated into machine language
c) Translation of high-level language into machine language
d) None of the mentioned

View Answer

Answer: c [Reason:] A computer program when from the equivalent source program into machine language by the compiler or assembler.

7. ( Z,* ) be a structure, and * is defined by n * m =maximum ( n , m ) Which of the following statements is true for ( Z, * ) ?
a) ( Z,* ) is a monoid
b) ( Z,* ) is an algebraic group
c) ( Z,* ) is a group
d) None of the mentioned

View Answer

Answer: d [Reason:] It is neither a monoid nor a simple group nor algebraic group

8. The address code involves
a) Exactly 3 address
b) At most Three address
c) No unary operators
d) None of the mentioned

View Answer

Answer: d [Reason:] In computer science, three-address is an intermediate code used by optimizing compilers to aid in the implementation of code-improving transformations.

9. An intermediate code form is
a) Postfix Notation
b) Syntax Trees
c) Three address code
d) All of the mentioned

View Answer

Answer: d [Reason:] Intermediate code generator takes an input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree.

10. Relocating bits used by relocating loader are specified by
a) Relocating loader itself
b) Linker
c) Assembler
d) Macro Processor

View Answer

Answer: b [Reason:] A linker or link editor is a computer 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.

Set 2

1. Input to code generator
a) Source code
b) Intermediate code
c) Target code
d) All of the mentioned

View Answer

Answer: b [Reason:] Intermediate code is the input to the code generator

2. 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 mentioned

View Answer

Answer: c [Reason:] Synthesized attribute’s value depend on children node only

3. 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 mentioned

View Answer

Answer: c [Reason:] 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

4. The graph that shows basic blocks and their successor relationship is called
a) DAG
b) Flow Chart
c) Control Graph
d) Hamilton graph

View Answer

Answer: b [Reason:] Flow chart shows basic blocks

5. _________ or scanning is the process where the stream of characters making up the source program is read from left to right and grouped into tokens.
a) Lexical Analysis
b) Diversion
c) Modelling
d) None of the mentioned

View Answer

Answer: a [Reason:] Lexical analysis is the process of converting a sequence of characters into a sequence of tokens

6. The output of a lexical analyzer is
a) Machine code
b) Intermediate code
c) A stream of tokens
d) A parse tree

View Answer

Answer: c [Reason:] the output of lexical analyzer is output token

7. _____________ is a graph representation of a derivation
a) The parse tree
b) Oct tree
c) Binary tree
d) None of the mentioned

View Answer

Answer: a [Reason:] parse tree is a representation of the derivation

8. Which of the following symbols table implementation is based on the property of locality of reference?
a) Hash Table
b) Search tree
c) Self organizing list
d) Linear list

View Answer

Answer: c [Reason:] Self Organizing list is based on locality of reference

9. Which one of the following is a top-down parser?
a) Recursive Descent parser
b) Operator precedence parser
c) An LR(k) parser
d) An LALR(k) parser

View Answer

Answer: a [Reason:] Recursive Descent parsing is LL (1) parsing which is top down parsing

10. 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 mentioned

View Answer

Answer: b [Reason:] the output of lexical analyzer is output token

Set 3

1. Relocating bits used by relocating loader are specified by
a) Relocating loader itself
b) Linker
c) Assembler
d) Macro Processor

View Answer

Answer: b [Reason:] Takes an object files and combines them into a single executable file, library file, or another object file.

2. What is the binary equivalent of the decimal number 368
a) 10111000
b) 110110000
c) 111010000
d) 111100000

View Answer

Answer: b [Reason:] 368 binary equivalents is 8=1000 6=0110 3=0011 So 1101101000.

3. AB+(A+B)’ is equivalent to
a) A?B
b) A+B
c) (A+B)A
d) (A+B)B

View Answer

Answer: a [Reason:] It is equivalent to A? B.

4. A top down parser generates
a) Rightmost Derivation
b) Right most derivation in reverse
c) Left most derivation
d) Left most derivation in reverse

View Answer

Answer: c [Reason:] Top-down parsing is a parsing strategy where one first looks at the highest level of the parse tree and works down the parse tree by using the rewriting rules of a formal grammar.

5. Running time of a program depends on
a) Addressing mode
b) Order of computations
c) The usage of machine idioms
d) All of the mentioned

View Answer

Answer: d [Reason:] Run time, runtime or execution time is the time during which a program is running (executing).

6. Which of the following is the fastest logic
a) TTL
b) ECL
c) CMOS
d) LSI

View Answer

Answer: b [Reason:] In electronics, emitter-coupled logic (ECL) is a high-speed integrated circuit.

7. A bottom up parser generates
a) Right most derivation
b) Rightmost derivation in reverse
c) Leftmost derivation
d) Leftmost derivation in reverse

View Answer

Answer: b [Reason:] This corresponds to starting at the leaves of the parse tree also known as shift-reduce parsing.

Set 4

1. A grammar that produces more than one parse tree for some sentence is called
a) Ambiguous
b) Unambiguous
c) Regular
d) None of the mentioned

View Answer

Answer: a [Reason:] Ambiguous grammar has more than one parse tree.

2. An optimizer Compiler
a) Is optimized to occupy less space
b) Both of the mentioned
c) Optimize the code
d) None of the mentioned

View Answer

Answer: d [Reason:] In computing, an optimizing compiler is a compiler that tries to minimize or maximize some attributes of an executable computer program.

3. 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 mentioned

View Answer

Answer: c [Reason:] 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.

4. A latch is constructed using two cross coupled
a) AND OR gates
b) AND gates
c) NAND and NOR gates
d) NAND gates

View Answer

Answer: d [Reason:] It has two inputs and one output.

5. Pee Hole optimization
a) Loop Optimization
b) Local Optimization
c) Constant folding
d) Data Flow analysis

View Answer

Answer: c [Reason:] More loops are added.

6. The optimization which avoids test at every iteration is
a) Loop unrolling
b) Loop jamming
c) Constant folding
d) None of the mentioned

View Answer

Answer: a [Reason:] Execution speed is enhanced by sacrificing bits.

7. 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 displayed

View Answer

Answer: a [Reason:] Displays only some part of the data.

8. Shift reduce parsers are
a) Top down Parser
b) Bottom Up parser
c) May be top down or bottom up
d) None of the mentioned

View Answer

Answer: b [Reason:] Also known as shift reduce parser.

Set 5

1. DAG representation of a basic block allows
a) Automatic detection of local common sub expressions
b) Detection of induction variables
c) Automatic detection of loop variant
d) None of the mentioned

View Answer

Answer: a [Reason:] It detects local sub expression.

2. Inherited attribute is a natural choice in
a) Tracking declaration of a variable
b) Correct use of L and R values
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: a [Reason:] These attribute keep a check on variable declaration.

3. An intermediate code form is
a) Post-fix notation
b) Syntax Trees
c) Three Address code
d) All of the mentioned

View Answer

Answer: d [Reason:] Intermediate code generator receives input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree.

4. 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 mentioned

View Answer

Answer: d [Reason:] All these symbols are used to recover operator precedence parser from an error.

5. The output of lexical analyzer is
a) A set of regular expression
b) Syntax tress
c) Set of Token
d) String of Characters

View Answer

Answer: c [Reason:] lexical analysis is the process of converting a sequence of characters into a sequence of tokens.

6. Which of the following is used for grouping of characters into tokens?
a) Parser
b) Code optimization
c) Code generator
d) Lexical analyzer

View Answer

Answer: d [Reason:] lexical analysis is the process of converting a sequence of characters into a sequence of tokens.

7. Shift reduce parser are
a) Top down parser
b) Bottom up parser
c) Maybe both
d) None of the mentioned

View Answer

Answer: b [Reason:] 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.

8. A bottom up parser generates
a) Right most derivation
b) Right most derivation in reverse
c) Left most derivation
d) Left most derivation in reverse

View Answer

Answer: b [Reason:] 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.

9. A garbage is
a) Unallocated storage
b) Allocated storage whose access paths are destroyed?
c) Allocated storage
d) Uninitialized storage

View Answer

Answer: b [Reason:] These are more like memory locations with values whose pointers have been revoked.

10. A 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 mentioned

View Answer

Answer: c [Reason:] As the name suggests that it optimizes the code.