Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q31: Which register is used for base pointer in assembly?
- A: %eax
- B: %esp
- C: %ebp
- D: %edx
View Answer
C
Q32: The assembly instruction 'ret' is used to ________.
- A: Start a function
- B: Return from function
- C: Multiply operands
- D: Declare a variable
View Answer
B
Q33: Which component has the highest grading percentage in the course?
- A: Theory
- B: Homeworks
- C: Project
- D: Exams
View Answer
C
Q34: Understanding compilers helps in writing ______ code.
- A: Slower
- B: Unstructured
- C: Better optimized
- D: Buggy
View Answer
C
Q35: Which part of the code represents human-readable format?
- A: Assembly
- B: Hexadecimal
- C: Source code
- D: Object code
View Answer
C
Q36: Which language is NOT mentioned as a typical compiler source?
- A: Java
- B: FORTRAN
- C: Python
- D: Pascal
View Answer
C
Q37: An ideal translation algorithm for compilers ______.
- A: Exists for all cases
- B: Is easy to implement
- C: Does not exist
- D: Is trivial
View Answer
C
Q38: The translation process in compilers is handled through ________.
- A: One single algorithm
- B: Multiple passes
- C: Single loop
- D: Manual conversion
View Answer
B
Q39: What is the main advantage of a two-pass compiler?
- A: Faster compilation
- B: Less memory usage
- C: Supports multiple front and back ends
- D: Generates bytecode
View Answer
C
Q40: Which part of the compiler maps legal source code to intermediate representation?
- A: Back end
- B: Scanner
- C: Parser
- D: Front end
View Answer
D