7 Qs · 2012–2023 · 10 marks · 0.4 marks/paperStandard yield
In Compiler Design, GATE tests Runtime Environments through conceptual and tracing questions on activation records, procedure activation trees, runtime memory allocation strategies… Guide
int main()
{
f1();
f2(2);
f3();
return(0);
}
int f1()
{
return(1);
}
int f2(int X)
{
f3();
if (X==1)
return f1();
else
return (X*f2(X-1));
}
int f3()
{
return(5);
}
Which one of the following options represents the…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);}Program main;
Var ...
Procedure A1;
Var ...
Call A2;
End A1
Procedure A2;
Var ...
Procedure A21;
Var ...
Call A1;
End A21
Call A21;
End A2
Call A1;
End main.…Topic guide
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).
Activation Tree Structure and Traversal Properties
common · MCQ · 1.5 marks · 2023, 2021
Given a program with nested or recursive calls, determine its activation tree structure or identify the relationship between call/return sequences and tree traversal orders (preorder/postorder).
Runtime Memory Allocation and Recursion Requirements
common · MCQ · 1 marks · 2020, 2014
Evaluating statements regarding static allocation, dynamic stack allocation, heap allocation, and garbage collection in the context of recursion and procedure execution.
Access Links (Static Links) in Nested Lexical Scopes
occasional · MCQ · 2 marks · 2012
Given a block-structured pseudo-language program with nested procedures and a specific dynamic calling chain, identify the correct static/access links in the activation record stack.
Code Tracing with Scoping and Parameter Passing
occasional · MCQ · 2 marks · 2016
Tracing program execution to compute printed output when combinations of static vs. dynamic scoping and pass-by-value vs. pass-by-reference are specified.
Procedure Call Sequence Traversal
Used when relating the chronological order of entering procedure activations to activation tree traversals.
Procedure Return Sequence Traversal
Used when relating the chronological order of procedure completions/returns to activation tree traversals.
Access Link (Static Link) Pointer Target
Used to find non-local variable environments under lexical (static) scoping regardless of dynamic caller.
Shift from tracing nested access links and dynamic scope code execution to formal graph-theoretic properties of activation trees (traversals and call tree generation).
2023, 2021, 2016, 2012
Consistent focus on testing misconceptions around runtime storage requirements for recursion (specifically establishing that call stacks are necessary while heaps and garbage collection are not).
2020, 2014
Easy questions (1 mark) test standard runtime environment definitions (e.g., distinguishing compile-time from runtime activities, activation tree traversal identities). Medium questions (1-2 marks) involve tracing non-trivial recursive execution to produce activation trees, tracing multi-scope variable mutations under dynamic scoping with references, or analyzing static access link pointers across deep lexical nesting.