Compiler Design (CD) AKTU previous year questions 2017–2026
Every Compiler Design question from 12 AKTU papers, tagged by unit, topic and marks. A few recent questions from each unit are listed below; open the page to filter by unit, topic or mark type.
Unit 1: Compiler Foundations, Lexical Analysis and Syntactic Specification – AKTU PYQs
- What is a lexical analyzer generator? Name any one tool. (2 marks, 2026, Lexical-Analyzer Generator)
- Construct DFA for the regular expression: (a+b)∗ab (2 marks, 2026, Finite State Machines and Regular Expressions for Lexical Analysis)
- Check whether given grammar is ambiguous or not. If ambiguous then convert it into unambiguous grammar: E → E + E | E*E | id (7 marks, 2026, Ambiguity)
- Explain context-free grammars and their applications in syntax analysis. Discuss derivation and parse trees. (7 marks, 2026, Formal Grammars and Their Application to Syntax Analysis)
- Design a lexical analyzer to recognize identifiers, keywords, integers, and operators of a programming language. (7 marks, 2026, Implementation of Lexical Analyzers)
Unit 2: Basic Parsing Techniques and Automatic Construction of Efficient Parsers – AKTU PYQs
- Differentiate between top-down and bottom-up parsing. (2 marks, 2026, Parsers)
- Describe bottom-up parsing techniques in detail. Explain shift-reduce parsing with example. (7 marks, 2026, Shift-Reduce Parsing)
- Discuss LR parsing in detail. Explain LR(0), SLR, CLR, and LALR parsers with comparison. (7 marks, 2026, LR Parsers)
- Construct CLR parsing table for the following grammar: S→ CC C→ cC |d (7 marks, 2026, Construction of Canonical LR Parsing Tables)
- State any two differences between top-down and bottom-up parsing. (2 marks, 2025, Parsers)
Unit 3: Syntax-Directed Translation and Intermediate Code – AKTU PYQs
- Define Boolean expression translation. (2 marks, 2026, Translation of Boolean Expressions)
- Why are quadruples preferred over triples in an optimizing compiler? (2 marks, 2026, Quadruples and Triples)
- Describe translation schemes for assignment statements and arithmetic expressions. (7 marks, 2026, Translation of Assignment Statements)
- Explain three-address code representation and discuss quadruples, triples, and indirect triples. (7 marks, 2026, Three-Address Code)
- Generate postfix notation and three-address code for : (a+b)∗(c−d)+e (7 marks, 2026, Intermediate Code)
Unit 4: Symbol Tables, Run-Time Administration and Error Recovery – AKTU PYQs
- List various error recovery strategies for a lexical analysis. (2 marks, 2026, Error Detection and Recovery)
- Explain symbol table organization and discuss different data structures used for symbol tables. (7 marks, 2026, Data Structures for Symbol Tables)
- Discuss various error recovery techniques used in compiler design. (7 marks, 2026, Error Detection and Recovery)
- Explain the role of a hash table in implementing a symbol table. (2 marks, 2025, Data Structures for Symbol Tables)
- Analyze the role of symbol tables in different phases of compilation. How does symbol table interact with lexical, syntax, and semantic analyzers? (7 marks, 2025, Data Structures for Symbol Tables)
Unit 5: Code Generation and Code Optimization – AKTU PYQs
- What is common subexpression elimination? (2 marks, 2026, Machine-Independent Optimizations)
- Explain the issues involved in code generation and discuss characteristics of target machine. (7 marks, 2026, Code Generation Design Issues)
- Construct DAG for the expression and optimize the code: a = b ∗ c + b ∗ c + d (7 marks, 2026, DAG Representation of Basic Blocks)
- What is machine-independent code optimization? (2 marks, 2025, Machine-Independent Optimizations)
- Explain the major design issues in code generation. How do these issues impact the performance of a compiler? (7 marks, 2025, Code Generation Design Issues)