CS606 Solved Subjective by SAHER.pdf
Verified academic study resource for CS606 (Compiler Design & Construction) under the Computer Science at Virtual University of Pakistan. This PDF document (Mega Solved MCQs Question Bank) covers Full Course Curriculum spanning approximately 180 pages across 8 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS606 – Compiler Design & Construction
- Faculty
- Computer Science
- Format
- Type
- MCQ Bank
- Coverage
- Full Course Curriculum
- Tags
- SUBJECTIVE, SOLVED
Cross-verify solutions against official lecture handouts. Practice active recall before checking answers to ensure true concept retention.
What this file covers — CS606 syllabus roadmap
- Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
- Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
- Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
- Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
- Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
- Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
- Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
- Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)
Frequently asked questions
Where can I download CS606 Solved Subjective by SAHER.pdf for free?
You can preview and download "CS606 Solved Subjective by SAHER.pdf" (CS606 PDF, ~180 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs606-solved-subjective-by-saher-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS606 file?
This document covers Full Course Curriculum across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS606 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS606 solved past papers and handouts verified for 2026 exams?
Yes. All CS606 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
CS606 Solved Subjective by SAHER
(VISIT VURANK FOR MORE)
_________
1)
What is live variable?
ANSWER: Page no: 128
A variable is live at a given point in time if it has a next use. Liveness tells us
whether we care about the value held by a variable. Here is the algorithm for
computing live status of variables in a basic block”.
2)
What are the common sub-expressions?
Answer: Page no: 135
A node in the DAG with more than one parent is common sub-expression
3)
What is Relocation?
Answer:
Compilers and assemblers generate the object code for each input module with a starting
address of zero. Relocation is the process of assigning load addresses to different parts of the
program by merging all sections of the same type into one section. The code and data section
also are adjusted so they point to the correct runtime addresses.
4)
Third section of YACC represents what kind of information? 3 Marks
Answer: Page no : 88
The third section represents C/C++ functions.
5)
Differentiate attribute grammar and syntax-directed grammar.
Answer: Page no: 100
Attribute grammar:
A CFG is augmented with a set of rules. Each symbol in the derivation has a set of values or
attributes.
Rules specify how to compute a value for each attribute
Syntax-directed grammar:
A syntax directed definition is a generalization of a context free grammar in which each
grammar symbol has an associated set of attributes, partitioned into two subsets called
the synthesized and inherited attributes of that grammar symbol.
6)
Brief note on Reducible Flow Graphs?
Answer:
7)
What kind of data structure is used to represent Basic Blocks?
Answer:
A basic block is a sequence of consecutive statements with single entry/single exit. Flow of
control only enters at the beginning and only leaves at the end. The can be variants of
basic blocks with single entry/multiple exit, multiple entry/single exit.
Page no 124
8)
Discuss the issue of Target programs in Code Generation phase?
Answer:
Memory management: mapping names to data objects in the run-time system.
• Instruction selection: the assembly language instructions to choose to encode
intermediate code statements
• Instruction scheduling: instruction chosen must utilize the CPU resources
effectively. Hardware stalls must be avoided.
• Register allocation: operands are placed in registers before executing machine
operation such as ADD, MULTIPLY etc. Most processors have a limited set of registers
available. The code generator has to make efficient use of this limited resource
Page no : 121
9)
How register descriptor are used in code generation? 5 Marks
Answer:
The code generator uses two data structures for keeping track of register usage
one is Register descriptor has register status (empty, in use) and contents (one
or more "values") Page no : 129
10)
Diff. Between Hop croft’s Algorithm and Subset Construction Algorithm?
Answer:
Hop croft’s Algorithm:
The Hop croft’s algorithm can be used to minimize DFA states. The behind the algorithm is
to find groups of equivalent states. All transitions from states in one group G1 go to states
in the same group G2. We construct the minimized DFA such that there is one state for
each group of states from the initial DFA.
Subset Construction Algorithm:
The algorithm is called subset construction. In the transition table of an NFA, each entry is
a set of states. In DFA, each entry is a single state. The general idea behind NFA-to-DFA
construction is that each DFA state corresponds to a set of NFA states. The DFA uses its
state to keep track of all possible states the NFA can be in after reading each input symbol.
11)
Role of Symbol Table
Answer:
Typically, the compiler augments the IR with a set of tables that record additional
information. Foremost among these is the symbol table. These tables are considered part
of the IR. Page no: 99
12)
What is LR(1) parsing and discuss main advantage?
Answer:
The LR(1) parsers can recognize precisely those languages in which one-symbol
lookahead suffices to determine whether to shift or reduce. The LR(1) construction
algorithm builds a handle-recognizing DFA.
Page no : 71
13)
How inherited attribute are different synthesized with respect to grammar attribute?
Answer:
Synthesized attributes:
Values used to compute synthesized attributes flow bottom-up in the parse tree.
Inherited attributes:
Values flow top-down and laterally in the parse tree.
Page no : 92
14)
From given CFG generate string aa+a*
S-> SS+ | SS* | a
Answer:
SSS+
SSS*
SSSS*+ Replace last S with >> SSS* it become a form of post order traversal.
SSS+S* Put symbols back using in order traversal
Saa+a* Replace all S on R.h.S with a and finally we get the string!
15)
S-> XX
X-> XXX | bX | Xb | a
Draw parse tree for string bbaaaab.
S
X X
X X X
Xb
bX a a
ab
ba
Answer:
SXX
SXXb placing last X with Xb
SXXXXb placing First X with XXX
SbXXXXb placing first X with bX
placing second X with
SbbXXXXb bX
Sbbaaaab
16)
Example of Syntax directed and translates it?
while a < b if c < d then x = y + z
else x = y – z
Answer:
The Syntax translation scheme will generate the following code:
L1: if a < b goto L2
goto Lnext
L2: if c < d goto L 3
More CS606 files
- CS606 MCQs JUNAID-1.pdf (PDF · MCQ Bank)
- CS606 MCQs JUNAID.pdf (PDF · MCQ Bank)
- CS606 SAMPLE PAPER 2023 SOLVED BY PRINCE ALVI.pdf (PDF · MCQ Bank)
- All Subjects Mid & Final 25000 Pdf Files.pdf (PDF · Final-Term)
- CS606 Finalterm Solved MCQs by Moaaz.pdf (PDF · Final-Term)
- CS606 FINAL TERM FILE 1 SOLVED BY TEAM HADI-1.pdf (PDF · Final-Term)
- CS606 FINAL TERM FILE 1 SOLVED BY TEAM HADI.pdf (PDF · Final-Term)
- CS606 FINAL TERM FILE 1 SOLVED BY TEAM HADI.pdf (PDF · Final-Term)