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. What are the two types of Linear Grammar?
a) Right Linear
b) Left Linear
c) None of the mentioned
d) Both of the mentioned

View Answer

Answer: d [Reason:] Linear grammar is of 2 types Left and Right Linear Grammar.

2. Which Grammar is it?
S → Aa A → Aab
a) Right Linear
b) Left Linear
c) None of the mentioned
d) Both of the mentioned

View Answer

Answer: b [Reason:] In Left-Linear grammars, all productions have the form: A→Bx or A→ x where x is some string of terminals.

3. Which Type of Grammar is it?
S → Aa A → Aab | λ
a) Right Linear
b) Left Linear
c) None of the mentioned
d) Both of the mentioned

View Answer

Answer: b [Reason:] In this case they both correspond to the regular expression (ab)*a.

4. A Regular Grammar is any right-linear or left-linear grammar.
a) True
b) False

View Answer

Answer: a [Reason:] As it turns out the languages that can be generated by Regular Grammars is equivalent to those that can be specified by Regular Expressions.

5. Regular Grammars generate Regular Languages.
a) True
b) False

View Answer

Answer: a [Reason:] That’s why they are called regular languages.

6. Can Left Linear grammar be converted to Right Linear grammar?
a) Yes
b) No

View Answer

Answer: a [Reason:] Since right-linear grammars are regular, it follows that left-linear grammars are also regular.

7. CFG is
a) Compiler
b) A language expression
c) Regular Expression
d) None of the mentioned

View Answer

Answer: b [Reason:] They are defined by rule A->b where A is non terminal and b is terminal.

Set 2

1. Transition of finite automata is
a) Finite Diagram
b) State Diagram
c) Node Diagram
d) E-R Diagram

View Answer

Answer: b [Reason:] Transition of finite automata is Finite Diagram.

2. A context free language is called ambiguous if
a) It has 2 or more than 2 left derivations for some terminal string ѡ є L (G)
b) It has 2 or more than 2 left derivations for some terminal string ѡ є L (G)
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: c [Reason:] When two or more Left and right most derivative occur the grammar turn ambiguous.

3. Which of the following statement is true?
a) Every language that is defined by regular expression can also be defined by finite automata
b) Every language defined by finite automata can also be defined by regular expression
c) We can convert regular expressions into finite automata
d) All of the mentioned

View Answer

Answer: d [Reason:] All these statements are true w.r.t regular expression.

4. Which of the following identity is wrong?
a) R + R = R
b) (R*)* = R*
c) ɛR = Rɛ = R
d) ØR = RØ = RR*

View Answer

Answer: d [Reason:] Regular grammar combined with empty does not give R* instead gives empty.

5. Grammars that can be translated to DFAs
a) Left linear grammar
b) Right linear grammar
c) Generic grammar
d) All of the mentioned

View Answer

Answer: b [Reason:] Right Linear grammar can be translate to DFA.

6. A language is regular if and only if it is accepted by finite automata
a) The given statement statement is true
b) Given statement is false
c) Statement is partially true
d) None of the mentioned

View Answer

Answer: a [Reason:] Regular Language is accepted by Finite Automata. Every regular language is Context free.

7. A Push Down Automata is if there is at most one transition applicable to each configuration
a) Deterministic
b) Non deterministic
c) Finite
d) Non finite

View Answer

Answer: a [Reason:] In every situation only one transition is available as continuation then the result is deterministic push down automata.

Set 3

1. In a single pass assembler, most of the forward references can be avoided by putting the restriction
a) On the number of strings/life reacts
b) Code segment to be defined after data segment
c) On unconditional rump
d) None of the mentioned

View Answer

Answer: b [Reason:] A single pass assembler scans the program only once and creates the equivalent binary program.

2. The method which merges the bodies of two loops is
a) Loop rolling
b) Loop jamming
c) Constant folding
d) None of the mentioned

View Answer

Answer: b [Reason:] In computer science, loop fusion (or loop jamming) is a compiler optimization and loop transformation which replaces multiple loops with a single one.

3. Assembly code data base is associated with
a) Code is converted into assembly
b) Table of rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
c) None of the mentioned
d) Both of the mentioned

View Answer

Answer: a [Reason:] An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture’s machine code instructions.

4. The process manager has to keep track of
a) Status of each program
b) Information to a programmer using the system
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: c [Reason:] Process manager keep track of the status and info about the program.

5. Function of the syntax phase is to
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 language

View Answer

Answer: a [Reason:] In this phase symbol table is created by the compiler which contains the list of lexemes or tokens.

6. If E be a shifting operation applied to a function f, such that E(f) = f (x +β ), then
a) E (αf+β g) =α E(f) +β E (g)
b) E (αf +β g )=. ( α+ β )+ E (f + g)
c) E (αf +β g )=α E (f+gβ)
d) E (αf +β g )=αβ E (f + g)

View Answer

Answer: a [Reason:] Shifting operation when performed gives this result.

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

View Answer

Answer: d [Reason:] The pass 1 of a compiler the above mentioned functions are performed.

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

View Answer

Answer: a [Reason:] A database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc Fields: Name of the symbol.

9. Which of the following functions is performed by loader?
a) Allocate memory for the programs and resolve symbolic references between objects decks
b) Address dependent locations, such as address constants, to correspond to the allocated space
c) Physically place the machine instructions and data into memory
d) All of the mentioned

View Answer

Answer: d [Reason:] A loader is the part of an operating system that is responsible for loading programs and libraries.

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

View Answer

Answer: b [Reason:] Root directory is placed at a fixed disk location.

Set 4

1. The segment base is specified using the register named is
a) ORG instructions
b) TITLE instruction
c) ASSUME instruction
d) SEGMENT instruction

View Answer

Answer: a [Reason:] ORG segment base register is used to specify the register.

2. In what module multiple instances of execution will yield the same result even if one instance has not terminated before the next one has begun?
a) Non- usable module
b) Serially usable
c) Re-enterable module
d) None of the mentioned

View Answer

Answer: c [Reason:] Re enterable module is the reason why the compiler is used in the first place.

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

View Answer

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

4. Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
a) O(1)
b) O(long)
c) O(n)
d) O(long)

View Answer

Answer: c [Reason:] For skewed binary search tree on n nodes, the upper bound to insert a node is O (n).

5. 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 0.

View Answer

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

6. Software that measures, monitors, and controls events is
a) System S/w
b) Real Time software
c) Scientific software
d) Business Software

View Answer

Answer: b [Reason:] In computer science, real-time computing (RTC), or reactive computing describes hardware and software systems subject to a “real-time constraint”, for example operational deadlines from event to system response.

7. A linker is given object module for a set of programs that were compiled separately. What is not true about an object module
a) Object code
b) Relocation bits
c) Names and locations of all external symbols denied in the object module
d) Absolute addresses of internal symbols

View Answer

Answer: d [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.

8. The table created by lexical analysis to describe all literals used in the source program is
a) Terminal table
b) Literal table
c) Identifier table
d) Reductions

View Answer

Answer: b [Reason:] In computer science, and specifically in compiler and assembler design, literal pool is a lookup table used to hold literals during assembly and execution.

9. Which loader function is accomplished by loader?
a) Reallocation
b) Allocation
c) Linking
d) Loading

View Answer

Answer: d [Reason:] Function of a loader.

10. Pass 2
a) Assemble instruction and generate data
b) Perform processing of assembler
c) Write the object program
d) All of the mentioned

View Answer

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

Set 5

1. A system program that combines separately compiled modules of a program into a form suitable for execution is
a) Assembler
b) Linking loader
c) Cross compiler
d) None of the mentioned

View Answer

Answer: b [Reason:] The definition of cross compiler.

2. A compiler for a high-level language that runs on one machine and produces code for a different machine is called
a) Optimizing compiler
b) One pass compiler
c) Cross compiler
d) Multipass compiler

View Answer

Answer: c [Reason:] So done by the definition.

3. Cross-compiler is a compiler
a) Which is written in a different language from the source language?
b) That generates object code for the machine it’s running on.
c) Which is written in the same language as the source language?
d) That runs on one machine but produces object code for another machine

View Answer

Answer: a [Reason:] A compiler for a high-level language that runs on one machine and produces code for a different machine is called a cross compiler.

4. Cross compiler is used in Bootstrapping.
a) True
b) False

View Answer

Answer: a [Reason:] Bootstrapping to a new platform. When a software is developed for a new platform, a cross compiler is used to compile necessary tools such as the OS and a native compiler.

5. Is GCC a cross Compiler ?
a) Yes
b) No

View Answer

Answer: a [Reason:] GCC, a free software collection of compilers, also can be used as cross compile. It supports many languages and platforms.

6. The __________ is a technique for building cross compilers for other machines.
a) Brazilian Cross
b) Canadian Cross
c) Mexican Cross
d) X-cross

View Answer

Answer: b [Reason:] The Canadian Cross is a technique for building cross compilers for other machines. Given three machines X, Y, and Z, one uses machine X (e.g. running Windows XP on an IA-32 processor) to build a cross compiler that runs on machine Y (e.g. running Mac OS X on an x86-64 processor) to create executables for machine Z.

7. __________ was developed from the beginning as a cross compiler.
a) Free Pascal
b) GCC
c) Pascal
d) None of these

View Answer

Answer: a [Reason:] Free Pascal was developed from the beginning as a cross compiler. The compiler executable (ppcXXX where XXX is target architecture) is capable of producing executables for all OS of the same architecture.

.woocommerce-message { background-color: #98C391 !important; }