Home › AKTU PYQ › Compiler Design › PYQ Questions › Unit 1

Compiler Design Unit 1 – Compiler Foundations, Lexical Analysis and Syntactic Specification: AKTU previous year questions

12 AKTU questions from Unit 1 (Compiler Foundations, Lexical Analysis and Syntactic Specification) asked in 2024–2026, tagged by marks, year and topic. In short: about 22 marks of every paper come from this unit; the most asked topic is Finite State Machines and Regular Expressions for Lexical Analysis (19 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 1 previous year questions

  • 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)
  • Differentiate between phases and passes of a compiler. (2 marks, 2025, Compiler Phases and Passes)
  • What is the Finite State Machines (FSM)? Design a FSM that accepts all strings of a and b containing even number of a’s and odd number of b’s. (2 marks, 2025, Finite State Machines and Regular Expressions for Lexical Analysis)
  • Explain in detail the process of compilation. Illustrate the output of each phase of compilation of the input “a = (b + c)*(b + c)* 2”. (7 marks, 2025, Compiler Phases and Passes)
  • Using rightmost derivations or the derivation trees show that the grammar with following production rules is ambiguous S → aSbS | bSaS | ε (7 marks, 2025, Ambiguity)
  • Define bootstrapping in the context of compilers. (2 marks, 2024, Bootstrapping)
  • Construct regular expression to accept valid identifier containing letters, digits, and underscore. (2 marks, 2024, Finite State Machines and Regular Expressions for Lexical Analysis)
  • Which phase of compiler is optional and why? (2 marks, 2024, Compiler Phases and Passes)

Most asked Unit 1 topics

  • Finite State Machines and Regular Expressions for Lexical Analysis – asked 19 times
  • Compiler Phases and Passes – asked 14 times
  • Ambiguity – asked 6 times

Unit 1 question pattern

  • 2-mark questions: 7 asked in 2024–2026
  • 7-mark questions: 5 asked in 2024–2026
  • About 22 marks from Unit 1 in every paper
  • 2 questions were asked again in a later year

Unit 1 questions year by year

  • 2026: 5 Unit 1 questions asked (25 marks across that year's papers)
  • 2025: 4 Unit 1 questions asked (18 marks across that year's papers)
  • 2024: 3 Unit 1 questions asked (6 marks across that year's papers)