The following Compiler Design MCQs have been compiled by our experts through research, in order to test your knowledge of the subject of Compiler Design. We encourage you to answer these 40 multiple-choice questions to assess your proficiency.
Please continue by scrolling down.
A. A greedy algorithm always gives an optimal problem solution.
B. A greedy algorithm can be recursive.
C. A greedy algorithm can be iterative.
D. A greedy algorithm can be used with graph data structures.
A. Breadth-first search algorithm
B. Fast Fourier transform algorithm
C. Dijkstra's algorithm
D. Prim's algorithm
A. It is always possible.
B. It is always impossible.
C. It is possible only in complex analysis but not in real domain.
D. It is possible only the determinant of first matrix is non-zero.
A. No, it isn't.
B. Yes, but only in SBCL.
C. Yes, in all implementations.
D. Yes, except in CMUCL.
A. It will raise an exception
B. It will return nil
C. It will return (nil nil)
D. It will return (nil nil t)
A. They involve huge memory fragmentation.
B. They can not be thread-safe.
C. They can make real-time systems hang for some period of time.
D. All of the above
A. It allows to have memory chunks of any size
B. It obtains large blocks of memory from the system memory manager and allocates the memory to the application in smaller pieces.
C. It hides memory leaks from the operating system
D. All of the above answers are correct
A. There are no such type predicates, so the question is incorrect
B. eq is true only when tested object are the same identical object and eql is true only when tested objects have the same type and value
C. eql is true only when tested objects are the same identical object and eq is true only when tested objects have the same type and value
D. eq is a function, whereas eql is a macro.
A. To prove the stability of an algorithm.
B. To analyze an algorithm behavior on random input data
C. To find out the average algorithm performance in worst case
D. None of the above
A. A program for the vulnerability analysis of a bytecode.
B. A program for automatic translation of a bytecode from Unicode to UTF-8.
C. A program which executes bytecode instructions.
D. All of the above.
A. Code branching prediction
B. Constants folding and propagation
C. Loop invariant relocation outside
D. Common subexpressions elimination in a code blocks
A. Counting sort
B. Bucket sort
C. Radix sort
D. All of the above
A. An optimal binary search tree can be used only with unique nodes values
B. An optimal binary search tree has less average expected search time as compared with a general binary search tree's one.
C. An optimal binary search tree can not be used for solving optimization problems.
D. All of the above
A. A phase in incremental garbage collection.
B. A phase in generational garbage collection.
C. A fast and memory-effective sorting algorithm.
D. None of the above
A. A problem which can not be solved using a Turing machine
B. A problem which cannot be solved quickly.
C. A problem which can not be solved without involving neural networks involvement
D. None of the above
A. An SSAG is more suitable for a code optimization than a CFG.
B. All SSAG graph elements have unique names but CFG ones do not.
C. SSAG graph construction is much more complicated than CFG construction.
D. All of the above.
A. standard-string-p
B. standard-char-p
C. simple-bit-vector-p
D. random-state-p
A. ||||
B. <><><>M<
C. ?/?
D. #?#
A. Finite state machine
B. Indefinite state machine
C. Petri net
D. Language grammar rules interpreter
A. Long branch instruction
B. Short branch instruction
C. All instructions are equal in CPU resources consumption
D. RISC processor typically has only long branch instruction. The question therefore is incorrect
A. Syntax errors handling in a program sources
B. Semantic errors handling in a program sources
C. Converting a program sources to a syntax tree
D. Applying a language grammar rules to a program sources
A. They are one and the same thing.
B. Lexical analysis includes syntax analysis.
C. Syntax analysis includes lexical analysis
D. They have no relationship with each other.
A. Sequential load and store instructions elimination
B. Identifying patterns in the instruction stream which are known to be performance gaps
C. Constants folding in the memory addresses used by the generated instructions
D. Optimization of the generated code by performing branching analysis algorithms which take target machine characteristics into account
A. They map to the same instruction position in the generated code
B. They produce the same result when called
C. They write to the same memory location when called
D. They share the same output stream block in a code generation phase
A. By using the memcpy function.
B. By using a loop.
C. By using a SSE3 instructions for fast memory chunks movement.
D. All of the above approaches are equivalent
A. They keep track of memory leaks in an application
B. They allow to allocate memory chunks of any required size
C. Memory management systems based on segregated lists are extremely fast
D. All of the above
A. *query-io*
B. *terminal-input*
C. *trace-output*
D. *debug-io*
What does the following Common Lisp line describes?
(vector 'integer 1234567890)
A.
This is a vector of integer type whose absolute value can not be more than 1234567890
B.
This is a vector of integers and its tag index is 1234567890
C.
This is a vector of integers and its length is 1234567890Â Â
D.
This type definition is incorrect
A. `
B. ,
C. %
D. #
A. By using a hash map.
B. By using a B-tree.
C. By using a binary search tree.
D. All of the above
A. That algorithm
B. That algorithm
C. That algorithm
D. None of the above
A. Train algorithm
B. Baker algorithm
C. Cheney algorithm
D. Car algorithm
A. Yes, and in case of all garbage collector types.
B. Yes, but only in the case of a generational garbage collector.
C. Yes, but only in the case of an incremental garbage collector.
D. It is not possible to prove the theoretical stability of any garbage collector type.
A. They are all optional variables names
B. x is a variable name, y is a binding flag and z is the default value for the variable x
C. y is a variable name, x is a binding flag and z is the default value for the variable y
D. x is a variable name, z is a binding flag and y is the default value for the variable x
A. Simple reference counting
B. Deferred reference counting
C. 1-bit reference counting
D. Composed reference counting
A. Bitmapped memory allocation scheme belongs to automated memory management methods, so question is incorrect.
B. It is extremely hard to code on C and requires a great debugging effort before it starts working.
C. Iit causes huge and frequent memory fragmentations.
D. It allocates memory too slow.
A. It happens when a object created, is not destroyed.
B. It happens when memory is still marked as used even after the object has been deleted.
C. It happens when two objects hold references to each other and thus they cannot be deleted.
D. All of the above
A. registers relation map
B. registers interference graph
C. registers dependency list
D. registers allocation tree
A. It has risk of misidentifying an application data as a heap pointer
B. It tends to have memory leaks in its own implementation
C. It is not suitable for use with low-level (such as C) languages
D. It is the slowest type of garbage collectors
A. e
B. eq
C. eql
D. equal