Skip to main content

Compiler Construction MCQs with Answers

Practice important Compiler Construction MCQs with answers and explanations.

Chapter: 4
Q121:
Run-time type checking ensures ______.
A. Code comments are valid
B. Memory is released properly
C. Correct data types at execution
D. Registers are reused
Correct Answer: C
Chapter: 4
Q122:
Which of the following is **not** a responsibility of the runtime system?
A. Register allocation
B. Garbage collection
C. Run-time error handling
D. Parallel thread management
Correct Answer: A
Chapter: 4
Q123:
Which resource may a process request from the OS at runtime?
A. Input/Output
B. Compilation
C. Parsing
D. Linking
Correct Answer: A
Chapter: 4
Q124:
The application may spawn ______ at runtime.
A. More classes
B. More processes or threads
C. More headers
D. More compilers
Correct Answer: B
Chapter: 4
Q125:
Support for communication and synchronization is crucial in ______.
A. Code optimization
B. Sequential programs
C. Parallel execution
D. Runtime linker
Correct Answer: D
Chapter: 4
Q126:
Garbage collection occurs during ______.
A. Compilation
B. Linking
C. Run-time
D. Parsing
Correct Answer: C
Chapter: 4
Q127:
What term describes a computation that can be skipped without affecting results?
A. Redundant
B. Recursive
C. Traced
D. Abstract
Correct Answer: A
Chapter: 4
Q128:
Which stage of the compiler deals with syntax and semantic analysis?
A. Front end
B. Back end
C. Middle end
D. Runtime
Correct Answer: A
Chapter: 4
Q129:
What follows after code generation in a compiler?
A. Optimization
B. Execution
C. Linking
D. Error checking
Correct Answer: B
Chapter: 4
Q130:
In instruction scheduling, functional units must be ______.
A. Bypassed
B. Shut down
C. Used productively
D. Compiled separately
Correct Answer: C
Chapter: 4
Q131:
What does NP-Complete indicate about a problem like register allocation?
A. It has no known efficient solution
B. It’s a programming language
C. It’s a compiler error
D. It’s a syntax feature
Correct Answer: A
Chapter: 4
Q132:
_______ architecture uses a simple set of instructions.
A. RISC
B. CISC
C. VLSI
D. ISA
Correct Answer: A
Chapter: 4
Q133:
CISC architecture offers ______.
A. Minimal instructions
B. Rich set of instructions and addressing modes
C. Limited addressing
D. Lexical analysis
Correct Answer: B
Chapter: 4
Q134:
Which stage performs run-time error/exception processing?
A. Middle end
B. IR generator
C. Runtime system
D. Parser
Correct Answer: C
Chapter: 4
Q135:
In compiler construction, IR stands for ______.
A. Intermediate Rule
B. Intermediate Representation
C. Instruction Reader
D. Input Register
Correct Answer: B
Chapter: 4
Q136:
The optimizer can move computations to ______.
A. Frequently executed paths
B. Less frequently executed paths
C. Main memory
D. Registers
Correct Answer: B
Chapter: 4
Q137:
During optimization, a constant value may be ______.
A. Skipped
B. Extracted and replaced
C. Removed entirely
D. Changed into variable
Correct Answer: B
Chapter: 4
Q138:
One pass in the optimizer might involve ______.
A. Code styling
B. Loop unrolling
C. Instruction decoding
D. Removing IDE-specific tags
Correct Answer: B
Chapter: 5
Q139:
What is the first component of the front-end of a compiler?
A. Scanner
B. Parser
C. Lexer
D. Optimizer
Correct Answer: A
Chapter: 5
Q140:
The scanner breaks the input stream into ________.
A. commands
B. instructions
C. tokens
D. bytes
Correct Answer: C

Test Your Knowledge

Take a timed quiz on Compiler Construction

🚀 Start Quiz Now