Compiler Design Unit 5 – Code Generation and Code Optimization: AKTU previous year questions
12 AKTU questions from Unit 5 (Code Generation and Code Optimization) asked in 2024–2026, tagged by marks, year and topic. In short: about 25 marks of every paper come from this unit; the most asked topic is DAG Representation of Basic Blocks (11 times); 2 questions came back in a later year. The latest ones are listed below; on the page you can filter them by 2-mark or long questions, topic and repeats.
Unit 5 previous year questions
- 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)
- Discuss the optimization techniques used at the basic block level. Explain with an example how a basic block can be optimized. (7 marks, 2025, Optimization of Basic Blocks)
- What are the principle sources of optimization of code? How the DAG is used in common sub-expression elimination? Discuss in details. (7 marks, 2025, DAG Representation of Basic Blocks)
- Discuss two design issues in code generation. (2 marks, 2024, Code Generation Design Issues)
- Elaborate the design issues of code generation. (2 marks, 2024, Code Generation Design Issues)
- Explain the concept of global data-flow analysis. (2 marks, 2024, Global Data-Flow Analysis)
- Compute the number of nodes in Directed Acyclic Graph (DAG) for the following C code segment executed in the sequence: a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; (2 marks, 2024, DAG Representation of Basic Blocks)
- Construct target code for the following expression: x:=(a+b)*c+d/(a+b) (10 marks, 2024, Code Generator)
Most asked Unit 5 topics
- DAG Representation of Basic Blocks – asked 11 times
- Loop Optimization – asked 8 times
- Machine-Independent Optimizations – asked 7 times
Unit 5 question pattern
- 2-mark questions: 6 asked in 2024–2026
- 7-mark questions: 5 asked in 2024–2026
- 10-mark questions: 1 asked in 2024–2026
- About 25 marks from Unit 5 in every paper
- 2 questions were asked again in a later year
Unit 5 questions year by year
- 2026: 3 Unit 5 questions asked (16 marks across that year's papers)
- 2025: 4 Unit 5 questions asked (23 marks across that year's papers)
- 2024: 5 Unit 5 questions asked (18 marks across that year's papers)