Compiler Design — GATE CS Previous Year Questions
Practise GATE Compiler Design previous year questions, organized by topic. Filter by year, marks and MCQ, MSQ or NAT question type. Browse free previews; full access may require a paid plan.
Mapped syllabus topics
- Lexical Analysis & Parsing
- Syntax-Directed Translation
- Runtime Environments
- Intermediate Code Generation
- Local Optimisation & Data Flow Analysis
Public question previews
- Which of the following statements is/are true? (2026 · 1 mark · MSQ)
- In C runtime environment, which one of the following is stored in heap? (2026 · 1 mark · MCQ)
- A lexical analyzer uses the following token definitions • letter → [A - Z a - z] • digit → [0 - 9] • id → letter (letter | digit)* • number → digit+ • ws → (blank | tab | newline)+ For the string given below, x1 23mm 78 y 7z zz5 14A 8H AaYcD the number of tokens (excluding ws) that will be produced by the lexical analyzer is __________. (answer in integer) (2026 · 1 mark · NAT)
- Consider the canonical LR(0) parsing of the grammar below using terminals {a, b, c} and non-terminals {A, B, C, S} with S as the start symbol. S → ACB A → aA | ε C → cC | ε B → bB | b Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0) ACTION table? (2026 · 2 marks · MCQ)
- Which ONE of the following statements is FALSE regarding the symbol table? (2025 · 1 mark · MCQ)