GATE CS Runtime Environments questions
Practise Runtime Environments questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Consider the following program: 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 activation tree corresponding to the main function?
Consider the following statements. The sequence of procedure calls corresponds to a preorder traversal of the activation tree. The sequence of procedure returns corresponds to a postorder traversal of the activation tree. Which one of the following options is correct?
Consider the following statements. Symbol table is accessed only during lexical analysis and syntax analysis. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment. Errors violating the condition ‘any variable must be declared before its use’ are detected during syntax …
Consider the expression . Let be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which only load and store instructions can have memory operands and arithmetic instructions can have only register or immediate operands. The …
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); }
Which one of the following is NOT performed during compilation?
Which of the following statements are CORRECT? Static allocation of all data areas by a compiler makes it impossible to implement recursion. Automatic garbage collection is essential to implement recursion. Dynamic allocation of activation records is essential to implement recursion. Both heap and stack are essential to implement recursion.
The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have atmost two source operands and one destination operand. Assume that all variables are dead after this code segment. c = a + b; d = c * a; e = c + a; x = c * c; if (x > a) { y = a * a; } else { d = d * d; e = e * e; } …
Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The variables and are initially stored in memory. The binary operators used in this expression tree can be evaluated by the machine only when operands are in registers. The …
The program below uses six temporary variables . a = 1 b = 10 c = 20 d = a + b e = c + d f = c + e b = c + e e = b + f d = 5 + e return d + f Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?
Which languages necessarily need heap allocation in the runtime environment?
Which of the following are true? A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being …
Consider the following function void swap(int a, int b) { int temp; temp = a; a = b; b = temp; } In order to exchange the values of two variables and .
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i=100, j=5; void P(x) { int i=10; print(x+10); i=200; j=20; print (x); } main() {P(i+j);} If the programming language uses dynamic scoping and call by name parameter passing mechanism, the values …
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statistically linked libraries?
Dynamic linking can cause security concerns because
The process of assigning load addresses to the various parts of the program and adjusting the code and the data in the program to reflect the assigned addresses is called
Faster access to non-local variables is achieved using an array of pointers to activation records called a
A linker reads four modules whose lengths are and words, respectively. If they are loaded in that order, what are the relocation constants?
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?
