GATE CSE Compiler Design PYQ analysis
Topic-wise weightage of Compiler Design from the 15 official GATE CSE papers on this site (2017–2026), with every question listed under the syllabus topics it tests.
6.1
average marks per paper
60
PYQs (2017–2026)
5 / 5
syllabus topics asked
#10 of 11
subjects by marks
Compiler Design weightage by year
Per paper; a year with two sessions shows their average. Of the 60 questions, 38 MCQ, 8 MSQ, 14 NAT; 32 carry 2 marks.
| Measure | 20172 papers | 2018 | 2019 | 2020 | 20212 papers | 2022 | 2023 | 20242 papers | 20252 papers | 20262 papers | Average |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Marks | 5 | 5 | 6 | 4 | 8 | 4 | 8 | 8 | 6 | 5.5 | 6.1 |
| Questions | 3.5 | 3 | 4 | 3 | 5 | 3 | 5 | 5 | 4 | 3.5 | 4 |
Compiler Design topic-wise weightage
Every topic of the official syllabus, most marks first. Year columns show marks per paper; marks count each question once, under its main topic, while “Questions” also counts supporting topics.
| Topic | 20172 papers | 2018 | 2019 | 2020 | 20212 papers | 2022 | 2023 | 20242 papers | 20252 papers | 20262 papers | Marks | Questions | Share |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lexical analysis, parsing and syntax-directed translation | 3.5 | 5 | 6 | 4 | 4 | 4 | 3 | 6 | 4 | 3.5 | 64 | 43 | |
| Data flow analyses: constant propagation, liveness analysis and common subexpression elimination | – | – | – | – | 2 | – | 2 | – | 0.5 | 2 | 11 | 6 | |
| Intermediate code generation | 0.5 | – | – | – | 0.5 | – | 1 | 1 | 0.5 | – | 6 | 7 | |
| Local optimisation | – | – | – | – | 1 | – | – | 1 | 1 | – | 6 | 4 | |
| Runtime environments | – | – | – | – | 0.5 | – | 2 | – | – | – | 3 | 3 |
Compiler Design PYQs by topic
Newest first. A question can appear under up to three topics; one filed under another subject is marked with that subject.
Lexical analysis, parsing and syntax-directed translation
43 questions · 64 marks as main topic · asked in 10 of 10 years · last in 2026
- 2026 Session 1 · Q27Classify errors in three C string declarations1M · MSQ
- 2026 Session 1 · Q28True statements about LL(1) parsing1M · MSQ
- 2026 Session 1 · Q53Compare two SDDs for type declarations2M · MSQ
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string1M · NAT
- 2026 Session 2 · Q41Shift-reduce conflicts in the LR(0) table of a grammar2M · MCQ
- 2025 Session 1 · Q12False statement about the symbol table1M · MCQ
- 2025 Session 1 · Q46Rules for computing FIRST and FOLLOW sets2M · MSQ
- 2025 Session 2 · Q22Classify three SDT rules as S-attributed or L-attributed1M · MCQ
- 2025 Session 2 · Q40Is the grammar S → Aa | bAc | dc | bda SLR(1) or LALR(1)?2M · MCQ
- 2025 Session 2 · Q51LL(1) and ambiguity of two if-then-else grammars2M · MSQ
- 2024 Session 1 · Q26Which parsers are bottom-up1M · MSQ
- 2024 Session 1 · Q33Evaluate an expression under unusual precedence and associativity1M · NAT
- 2024 Session 1 · Q37Value computed by an SDD for the input MMLK2M · MCQ
- 2024 Session 1 · Q38Complete a grammar from its FIRST and FOLLOW sets2M · MCQ
- 2024 Session 2 · Q21Match compiler phases with what they produce or do1M · MCQ
- 2024 Session 2 · Q29False statements about SDDs and attribute evaluation1M · MSQ
- 2024 Session 2 · Q40Fill the missing cells of an LL(1) parsing table2M · MCQ
- 2024 Session 2 · Q65Number of items in GOTO(I0, S) for an SLR grammar2M · NAT
- 2023 · Q19ε-NFA accepting identifiers letter (letter | digit)*1M · MCQ
- 2023 · Q60Value of 10#011 under a binary-fraction translation scheme2M · NAT
- 2022 · Q13True statement about LALR/LR(1) parsers and compiler phases1M · MCQ
- 2022 · Q29Number of LR(0) items in goto on +1M · NAT
- 2022 · Q65Evaluating an expression with a syntax-directed translation2M · NAT
- 2021 Set 1 · Q15SLR(1) grammars, ambiguity and cubic-time CFG parsing1M · MCQ
- 2021 Set 1 · Q36What an SDT for int/bool declarations and expressions can type-check2M · MCQ
- 2021 Set 1 · Q41Fill the blank cells of an LL(1) parsing table2M · MCQ
- 2021 Set 2 · Q13Compiler phase that reports an error for 'Integer x;'1M · MCQ
- 2021 Set 2 · Q61Items in GOTO(GOTO(I0, <), <) for an LR(0) grammar2M · NAT
- 2020 · Q19Symbol table use, heap for recursion, declare-before-use errors1M · MCQ
- 2020 · Q34Reduction steps of a bottom-up parse of aaadbbb1M · NAT
- 2020 · Q43Which semantic rules are L-attributed2M · MCQ
- 2019 · Q13Kind of derivation used by LR parsers1M · MCQ
- 2019 · Q29FOLLOW set of B in S → Aa, A → BD, B → b | ε, D → d | ε1M · NAT
- 2019 · Q46Placeholders for inherited type attributes in a declaration grammar2M · MCQ
- 2019 · Q53Number of items in GOTO(I0, '(') for an LR(0) list grammar2M · NAT
- 2018 · Q18FALSE statement about compiler phases1M · MCQ
- 2018 · Q47Token sequence from longest-match lexer on bbaacabc2M · MCQ
- 2018 · Q48Precedence and associativity of the dollar and hash operators from a parse tree2M · MCQ
- 2017 Session 1 · Q27FOLLOW(Q) for P → xQRS, Q → yz | z, R → w | ε, S → y1M · MCQ
- 2017 Session 1 · Q53Number of control flow paths in a program with ten if-then-else statements2M · NAT
- 2017 Session 2 · Q15Match compiler inputs to the phase that processes them1M · MCQ
- 2017 Session 2 · Q16Relative power of canonical LR, SLR and LALR parsers1M · MCQ
- 2017 Session 2 · Q42Removing left recursion from an expression grammar2M · MCQ
Data flow analyses: constant propagation, liveness analysis and common subexpression elimination
6 questions · 11 marks as main topic · asked in 4 of 10 years · last in 2026
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG2M · MCQ
- 2026 Session 2 · Q45Live variables at the exit of each block in a loop CFG2M · MCQ
- 2025 Session 1 · Q13Optimisation that uses live variable analysis1M · MCQ
- 2023 · Q37Live variables at the exit of each block of a flow graph2M · MCQ
- 2021 Set 2 · Q40Additions and dereferences after common subexpression elimination2M · MCQ
- 2021 Set 2 · Q48Liveness: relation between OUT(S1) and IN(S2)2M · MCQ
Intermediate code generation
7 questions · 6 marks as main topic · asked in 5 of 10 years · last in 2025
- 2025 Session 2 · Q21Backpatching for Boolean and flow-of-control code1M · MCQ
- 2024 Session 2 · Q21Match compiler phases with what they produce or dosupporting · 1M · MCQ
- 2024 Session 2 · Q43Missing triples for x[i] = (p + r) * −s[i] + u/w2M · MCQ
- 2023 · Q11Front-end and back-end of a compiler1M · MCQ
- 2021 Set 2 · Q23Which is NOT an intermediate representation1M · MSQ
- 2017 Session 1 · Q22Static single assignment (SSA) form of three-address code1M · MCQ
- 2017 Session 2 · Q15Match compiler inputs to the phase that processes themsupporting · 1M · MCQ
Local optimisation
4 questions · 6 marks as main topic · asked in 3 of 10 years · last in 2025
- 2025 Session 1 · Q52Number of basic blocks in a three-address code2M · NAT
- 2024 Session 1 · Q39Basic blocks in three-address code for a nested loop2M · MCQ
- 2024 Session 2 · Q21Match compiler phases with what they produce or dosupporting · 1M · MCQ
- 2021 Set 1 · Q60Number of nodes in the DAG of a basic block2M · NAT
Runtime environments
3 questions · 3 marks as main topic · asked in 3 of 10 years · last in 2023