Compiler Design · Runtime Environments
Official IIT answer key · IISc Bangalore · Audited Aug 2026
GATE CSE 2016 Set 1 Q36 · MCQ · 2 marks
a=3;
void n(x) {x = x * a; print(x);}
void m(y) {a = 1; a = y - a; n(a); print(a);}
void main() {m(a);}Key concept
No account needed
Sit 5 related Runtime EnvironmentsPYQs as a guest. We'll score the set and show which traps cost marks — sign in only if you want to save the run.
Topic notes
In Compiler Design, GATE tests Runtime Environments through conceptual and tracing questions on activation records, procedure activation trees, runtime memory allocation strategies (static vs. stack vs. heap), and scoping rules combined with parameter-passing mechanisms. Questions alternate between 1-mark theoretical concept validation (e.g., requirements for recursion, activation tree traversals) and 2-mark procedural traces (e.g., determining static access links, program output under dynamic scoping, and activation tree construction).
Full Runtime Environments guide →What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed? a=3; void n(x) x = x * a; print(x); void m(y) a = 1; a = y - a; n(a); print(a); void main() m(a);
Topic-wise GATE CS PYQs with verified steps
Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.
