Subject analysis · 2017–2026

Compiler Design

Every GATE CS question on Compiler Design, with how the marks are spread across years and topics.

Practise Compiler Design

Questions

55

4 topics

Avg marks / year

8.5

85 marks over 10 years

Peak year

2021

15 marks

Trend

Rising

+89% last 3 yrs

Marks per year

Both shifts counted where there were two · peak highlighted

Rising +89%
avg 8.5
8
5
6
4
15
4
5
15
12
11
'17'18'19'20'21'22'23'24'25'26

Topic share

Share of Compiler Design's 85 marks

4

topics

  • Lexical Analysis & Parsing Architectures , LR , LALR)51%
  • Syntax-Directed Translation & Runtime Environments21%
  • Intermediate Code Generation & Local Code Optimization18%
  • Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination11%

Topic × year heatmap

Marks from each topic in each year — darker is heavier. Topics that light up every column are the safest bets.

'17'18'19'20'21'22'23'24'25'26
Lexical Analysis & Parsing Architectures , LR , LALR)5541621865
Syntax-Directed Translation & Runtime Environments23222322
Intermediate Code Generation & Local Code Optimization3543
Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination2214
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.

All 55 Compiler Design questions

2026 7 questions · 11 marks
  1. FN · Q27Consider the following C statements: c char str1 = "Hello; / Statement S1 / char str2 = "Hello;"; / Statement S2 / int str3 = "Hello"; / Statement S3 / Which o…Lexical Analysis & Parsing Architectures , LR , LALR) · MSQ · 1 mark
  2. FN · Q28Which of the following statements is/are true?Lexical Analysis & Parsing Architectures , LR , LALR) · MSQ · 1 mark
  3. FN · Q42Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common sub-expression…Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination · MCQ · 2 marks
  4. FN · Q53Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations. D is the start symbol, and int, float and id are the three terminal…Syntax-Directed Translation & Runtime Environments · MSQ · 2 marks
  5. AN · Q35A lexical analyzer uses the following token definitions • letter [A - Za - z] • digit [0 - 9] • id letter (letter digit) • number digit + • ws (blank tab newli…Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 1 mark
  6. AN · Q41Consider 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 A C cC…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  7. AN · Q45Consider the control flow graph given below. Which one of the following options is the set of live variables at the exit point of each basic block?Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination · MCQ · 2 marks
2025 8 questions · 12 marks
  1. FN · Q12Which ONE of the following statements is FALSE regarding the symbol table?Syntax-Directed Translation & Runtime Environments · MCQ · 1 mark
  2. FN · Q13Which ONE of the following techniques used in compiler code optimization uses live variable analysis?Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination · MCQ · 1 mark
  3. FN · Q46Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?Lexical Analysis & Parsing Architectures , LR , LALR) · MSQ · 2 marks
  4. FN · Q52Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is . (Answer in integer) 1001: i = 1 1002…Intermediate Code Generation & Local Code Optimization · NAT · 2 marks
  5. AN · Q21Consider the following statements about the use of backpatching in a compiler for intermediate code generation: (I) Backpatching can be used to generate code f…Intermediate Code Generation & Local Code Optimization · MCQ · 1 mark
  6. AN · Q22Given the following syntax directed translation rules: Rule 1: R AB \ B.i = R.i - 1; A.i = B.i; R.i = A.i + 1;\ Rule 2: P CD \ P.i = C.i + D.i; D.i = C.i + 2\…Syntax-Directed Translation & Runtime Environments · MCQ · 1 mark
  7. AN · Q40Given a Context-Free Grammar G as follows: S Aa bac dc bda A d Which ONE of the following statements is TRUE?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  8. AN · Q51Consider two grammars G 1 and G 2 with the production rules given below: G 1 : S if E then S if E then S else S a E b G 2 : S if E then S M M if E then M else…Lexical Analysis & Parsing Architectures , LR , LALR) · MSQ · 2 marks
2024 9 questions · 15 marks
  1. FN · Q26Which of the following is/are Bottom-Up Parser(s)?Lexical Analysis & Parsing Architectures , LR , LALR) · MSQ · 1 mark
  2. FN · Q37Consider the following syntax-directed definition (SDD). Given “MMLK” as the input, which one of the following options is the CORRECT value computed by the SDD…Syntax-Directed Translation & Runtime Environments · MCQ · 2 marks
  3. FN · Q38Consider the following grammar G , with S as the start symbol. The grammar G has three incomplete productions denoted by (1), (2), and (3). S daT (1) T aS bT (…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  4. FN · Q39Consider the following pseudo-code. L1: t1 = -1 L2: t2 = 0 L3: t3 = 0 L4: t4 = 4 t3 L5: t5 = 4 t2 L6: t6 = t5 M L7: t7 = t4 + t6 L8: t8 = a[t7] L9: if t8 <= go…Intermediate Code Generation & Local Code Optimization · MCQ · 2 marks
  5. AN · Q21Consider the following two sets: Set X P. Lexical Analyzer Q. Syntax Analyzer R. Intermediate Code Generator S. Code Optimizer Set Y 1. Abstract Syntax Tree 2.…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  6. AN · Q29Which of the following statements is/are FALSE?Syntax-Directed Translation & Runtime Environments · MSQ · 1 mark
  7. AN · Q40Consider the following context-free grammar where the start symbol is S and the set of terminals is \ a, b, c, d\ . S AaAb BbBa A cS B dS The following is a pa…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  8. AN · Q43Consider the following expression: x[i] = (p + r) - s[i] + u/w . The following sequence shows the list of triples representing the given expression, with entri…Intermediate Code Generation & Local Code Optimization · MCQ · 2 marks
  9. AN · Q65Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is \ a, b, c, d, \ , @\ S' S S SS Aa bac Bc bBa A d\ B…Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 2 marks
2023 3 questions · 5 marks
  1. FN · Q11Consider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the target hard…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  2. FN · Q37Consider the control flow graph shown: Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination · MCQ · 2 marks
  3. FN · Q60Consider the syntax directed translation given by the following grammar and semantic rules. Here N, I, F and B are non-terminals. N is the starting non-termina…Syntax-Directed Translation & Runtime Environments · NAT · 2 marks
2022 3 questions · 4 marks
  1. FN · Q13Which one of the following statements is TRUE?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  2. FN · Q29Consider the augmented grammar with +, , (, ), id as the set of terminals. S' S S S + R R R R P P P (S) id If I 0 is the set of two LR(0) items \ [S' S.], [S S…Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 1 mark
  3. FN · Q65Consider the following grammar along with translation rules. S S 1 \ T \ S.val = S 1.val T.val\ S T \ S.val = T.val\ T T 1 \% R \ T.val = T 1.val R.val\ T R \…Syntax-Directed Translation & Runtime Environments · NAT · 2 marks
2021 9 questions · 15 marks
  1. FN · Q15Consider the following statements: S 1 : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). S 2 : For any cont…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  2. FN · Q36Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, gi…Syntax-Directed Translation & Runtime Environments · MCQ · 2 marks
  3. FN · Q41Consider the following context-free grammar where the set of terminals is \ a, b, c, d, f\ S daT Rf T aS baT R caTR The following is a partially-filled LL(1) p…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  4. FN · Q60Consider the following C code segment: c a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; In a compiler, this code segment is represented internally as a…Intermediate Code Generation & Local Code Optimization · NAT · 2 marks
  5. AN · Q13Consider the following ANSI C program: c int main( ) Integer x; return 0; Which one of the following phases in a seven-phase C compiler will throw an error?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  6. AN · Q23In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?Intermediate Code Generation & Local Code Optimization · MSQ · 1 mark
  7. AN · Q40Consider the following ANSI C code segment: c z = x + 3 + y -> f1 + y -> f2; for (i = 0; i < 200; i = i + 2) if (z > i) p = p + x + 3; q = q + y -> f1; else p…Intermediate Code Generation & Local Code Optimization · MCQ · 2 marks
  8. AN · Q48For a statement S in a program, in the context of liveness analysis, the following sets are defined : USE(S) : the set of variables used in S IN(S) : the set o…Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression Elimination · MCQ · 2 marks
  9. AN · Q61Consider the following augmented grammar with \ , @, <, >, a, b, c as the set of terminals. S' S S S \ cS S SS S S@ S <S> S a S b S c Let I 0 = CLOSURE (\ S' S…Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 2 marks
2020 3 questions · 4 marks
  1. FN · Q19Consider the following statements: I. Symbol table is accessed only during lexical analysis and syntax analysis. II. Compilers for programming languages that s…Syntax-Directed Translation & Runtime Environments · MCQ · 1 mark
  2. FN · Q34Consider the following grammar: S aSB d B b The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is .Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 1 mark
  3. FN · Q43Consider the productions A PQ and A XY . Each of the five non-terminals A, P, Q, X and Y has two attributes: s is a synthesized attribute, and i is an inherite…Syntax-Directed Translation & Runtime Environments · MCQ · 2 marks
2019 4 questions · 6 marks
  1. FN · Q13Which one of the following kinds of derivation is used by LR parsers?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  2. FN · Q29Consider the grammar given below: S Aa A BD B b D d Let a, b, d and be indexed as follows: Compute the FOLLOW set of the non-terminal B and write the index val…Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 1 mark
  3. FN · Q46Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X 1, X 2, X 3, X 4, X 5 and X 6 be the place…Syntax-Directed Translation & Runtime Environments · MCQ · 2 marks
  4. FN · Q53Consider the augmented grammar given below: S' S S (L) id L L, S S Let I 0 = CLOSURE (\ [S' S]\ ) . The number of items in the set GOTO ( I 0 , ( ) is .Lexical Analysis & Parsing Architectures , LR , LALR) · NAT · 2 marks
2018 3 questions · 5 marks
  1. FN · Q18Which one of the following statements is FALSE?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  2. FN · Q47A lexical analyzer uses the following patterns to recognize three tokens T 1, T 2, and T 3 over the alphabet \ a,b,c\ . T 1: a? (b c) a T 2: b? (a c) b T 3: c?…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
  3. FN · Q48Consider the following parse tree for the expression a bcd e f, involving two binary operators and . Which one of the following is correct for the given parse…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks
2017 6 questions · 8 marks
  1. FN · Q12Consider the following intermediate program in three address code p = a - b q = p c p = u v q = p + q Which one of the following corresponds to a static single…Intermediate Code Generation & Local Code Optimization · MCQ · 1 mark
  2. FN · Q17Consider the following grammar: P xQRS Q yz z R w S y What is FOLLOW (Q)?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  3. FN · Q52Consider the expression (a - 1) (((b + c)/3) + d). Let X be the minimum number of registers required by an optimal code generation (without any register spill)…Intermediate Code Generation & Local Code Optimization · NAT · 2 marks
  4. AN · Q5Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it: List-I (P) Syntax tree (Q) Charact…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  5. AN · Q6Which of the following statements about parser is/are CORRECT? I. Canonical LR is more powerful than SLR. II. SLR is more powerful than LALR. III. SLR is more…Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 1 mark
  6. AN · Q32Consider the following expression grammar G : E E - T T T T + F F F (E) id Which of the following grammars is not left recursive, but is equivalent to G?Lexical Analysis & Parsing Architectures , LR , LALR) · MCQ · 2 marks