⚗️

Compilers & Programming Language Theory MCQ

Test your Compilers & PLT knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.

100 Questions 40 Beginner 40 Intermediate 20 Advanced
1

What are the main phases of a compiler?

2

What is lexical analysis?

3

What is a token in compiler design?

4

What is a parse tree (concrete syntax tree)?

5

What is an Abstract Syntax Tree (AST)?

6

What is a context-free grammar used for in compilers?

7

What is the difference between a compiler and an interpreter?

8

What is semantic analysis in compilers?

9

What is a symbol table in compilers?

10

What is intermediate representation (IR)?

11

What is register allocation in code generation?

12

What is instruction selection in code generation?

13

What is a recursive descent parser?

14

What is the difference between top-down and bottom-up parsing?

15

What is a shift-reduce conflict?

16

What is dead code elimination?

17

What is constant folding?

18

What is function inlining?

19

What is loop unrolling?

20

What is SSA (Static Single Assignment) form?

21

What is type inference?

22

What is a grammar conflict?

23

What is a language runtime?

24

What is the difference between compiled and interpreted languages?

25

What is a linker and what does it do?

26

What is name mangling in C++ compilers?

27

What is a virtual machine (VM) in the context of PLT?

28

What is bytecode?

29

What is garbage collection?

30

What is tail call optimization (TCO)?

31

What is a type system?

32

What is polymorphism in type systems?

33

What is a closure in programming languages?

34

What is currying?

35

What is pattern matching in programming languages?

36

What is a monad in functional programming?

37

What is the lambda calculus?

38

What is an interpreter vs a JIT compiler?

39

What is memoization and how is it used in PL implementations?

40

What is the difference between syntax and semantics in a programming language?

1

What is the Hindley-Milner type inference algorithm?

2

What is continuation-passing style (CPS)?

3

What is abstract interpretation?

4

What is the difference between static and dynamic scoping?

5

What is a dependent type system?

6

What is the Curry-Howard correspondence?

7

What is effect type systems?

8

What is dataflow analysis?

9

What is alias analysis in compilers?

10

What is loop-invariant code motion (LICM)?

11

What is strength reduction?

12

What is devirtualization?

13

What is escape analysis?

14

What is partial evaluation?

15

What is the difference between call-by-value, call-by-reference, and call-by-need?

16

What is monomorphization in generics/templates?

17

What is deforestation in functional programming compilation?

18

What is type erasure in generic programming?

19

What is a trampoline in programming languages?

20

How does an LL(1) parser decide which production to apply?

21

Why can left recursion break a recursive descent parser?

22

What distinguishes an LR(1) parser from an LR(0) parser?

23

What is the role of a lattice in dataflow analysis?

24

What problem does common subexpression elimination (CSE) solve?

25

In a control-flow graph, what is a dominator of a basic block?

26

What is the purpose of the FOLLOW set when constructing predictive parsing tables?

27

What is the main idea behind a two-pass assembler or compiler design?

28

What does it mean for a programming language to have first-class functions?

29

What is the difference between eager (strict) evaluation and lazy evaluation?

30

What is the purpose of three-address code as an intermediate representation?

31

What is a basic block in compiler analysis?

32

What problem does operator precedence parsing address?

33

What is the key idea behind generational garbage collection?

34

What is the difference between a mark-and-sweep collector and a copying collector?

35

What does "duck typing" mean in dynamically typed languages?

36

What is the purpose of a calling convention in compiled code generation?

37

What is the difference between a virtual method table (vtable) and inline caching?

38

What is a phi (φ) function used for in SSA-based intermediate representations?

39

What is the purpose of a thunk in lazy or call-by-name evaluation?

40

Why do many real-world type checkers use bidirectional type checking instead of pure inference or pure checking?