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.
What are the main phases of a compiler?
2What is lexical analysis?
3What is a token in compiler design?
4What is a parse tree (concrete syntax tree)?
5What is an Abstract Syntax Tree (AST)?
6What is a context-free grammar used for in compilers?
7What is the difference between a compiler and an interpreter?
8What is semantic analysis in compilers?
9What is a symbol table in compilers?
10What is intermediate representation (IR)?
11What is register allocation in code generation?
12What is instruction selection in code generation?
13What is a recursive descent parser?
14What is the difference between top-down and bottom-up parsing?
15What is a shift-reduce conflict?
16What is dead code elimination?
17What is constant folding?
18What is function inlining?
19What is loop unrolling?
20What is SSA (Static Single Assignment) form?
21What is type inference?
22What is a grammar conflict?
23What is a language runtime?
24What is the difference between compiled and interpreted languages?
25What is a linker and what does it do?
26What is name mangling in C++ compilers?
27What is a virtual machine (VM) in the context of PLT?
28What is bytecode?
29What is garbage collection?
30What is tail call optimization (TCO)?
31What is a type system?
32What is polymorphism in type systems?
33What is a closure in programming languages?
34What is currying?
35What is pattern matching in programming languages?
36What is a monad in functional programming?
37What is the lambda calculus?
38What is an interpreter vs a JIT compiler?
39What is memoization and how is it used in PL implementations?
40What is the difference between syntax and semantics in a programming language?
What is the Hindley-Milner type inference algorithm?
2What is continuation-passing style (CPS)?
3What is abstract interpretation?
4What is the difference between static and dynamic scoping?
5What is a dependent type system?
6What is the Curry-Howard correspondence?
7What is effect type systems?
8What is dataflow analysis?
9What is alias analysis in compilers?
10What is loop-invariant code motion (LICM)?
11What is strength reduction?
12What is devirtualization?
13What is escape analysis?
14What is partial evaluation?
15What is the difference between call-by-value, call-by-reference, and call-by-need?
16What is monomorphization in generics/templates?
17What is deforestation in functional programming compilation?
18What is type erasure in generic programming?
19What is a trampoline in programming languages?
20How does an LL(1) parser decide which production to apply?
21Why can left recursion break a recursive descent parser?
22What distinguishes an LR(1) parser from an LR(0) parser?
23What is the role of a lattice in dataflow analysis?
24What problem does common subexpression elimination (CSE) solve?
25In a control-flow graph, what is a dominator of a basic block?
26What is the purpose of the FOLLOW set when constructing predictive parsing tables?
27What is the main idea behind a two-pass assembler or compiler design?
28What does it mean for a programming language to have first-class functions?
29What is the difference between eager (strict) evaluation and lazy evaluation?
30What is the purpose of three-address code as an intermediate representation?
31What is a basic block in compiler analysis?
32What problem does operator precedence parsing address?
33What is the key idea behind generational garbage collection?
34What is the difference between a mark-and-sweep collector and a copying collector?
35What does "duck typing" mean in dynamically typed languages?
36What is the purpose of a calling convention in compiled code generation?
37What is the difference between a virtual method table (vtable) and inline caching?
38What is a phi (φ) function used for in SSA-based intermediate representations?
39What is the purpose of a thunk in lazy or call-by-name evaluation?
40Why do many real-world type checkers use bidirectional type checking instead of pure inference or pure checking?
What is the Hindley-Milner let-polymorphism and its restriction?
2What is intersection types in programming languages?
3What is the difference between nominal and structural typing?
4What is gradual typing?
5What is the semantic analysis phase and attribute grammars?
6What is operational semantics?
7What is denotational semantics?
8What is the difference between early and late binding in object-oriented languages?
9What is the Boehm-Berarducci encoding?
10What is the difference between System F and System Fω?
11What is the linear type system and its application to resource management?
12What is the Y combinator in lambda calculus?
13What is the Landin correspondence?
14What is algebraic effects and handlers?
15What is certified compilation (CompCert)?
16What is WebAssembly's type safety and its formal semantics?
17What is the principal types property in type inference?
18What is the relationship between CPS transformation and continuation monad?
19How does an LR parser generator construct its canonical collection of LR(0) item sets, and why does this determine the parser's states?
20In Hindley-Milner type inference, what does the occurs check in unification prevent, and what happens if it is omitted?