Run-Time-Environments
Question 1 |
Which one of the following is NOT performed during compilation?
Dynamic memory allocation | |
Type checking | |
Symbol table management | |
Inline expansion |
Question 1 Explanation:
Dynamic memory allocation is not performed during compilation, it occurs at run time only. At the time of compilation, compiler only compiles the instructions for dynamic memory allocation, like calloc, malloc….
Question 2 |
Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures permitted.
Program main; Var ... Procedure A1; Var ... Call A2; End A1 Procedure A2; Var ... Procedure A21; Var ... Call A1; End A21 Call A21; End A21 Call A1; End main.Consider the calling chain : Main->A1->A2->A21->A1 The correct set of activation records along with their access links is given by :
![]() | |
![]() | |
![]() | |
![]() |
Question 2 Explanation:

Main → A1 → A2 → A21 → A1
Since, Activation records are created at procedure exit time.
A1 & A2 are defined under Main ( ). So A1 & A2 access links are pointed to main.
A21 is defined under A2, hence its access link will point to A2.
Question 3 |
Which languages necessarily need heap allocation in the runtime environment?
Those that support recursion | |
Those that use dynamic scoping
| |
Those that allow dynamic data structures | |
Those that use global variables
|
Question 3 Explanation:
Dynamic memory is allocated on the heap by the system. So the languages which allow dynamic data structure require heap allocation at runtime.
Question 4 |
The use of multiple register windows with overlap causes a reduction in the number of memory accesses for
I.Function locals and parameters
II.Register saves and restores
III.Instruction fetches
I only
| |
II only | |
III only | |
I, II and III
|
Question 4 Explanation:
I is true because when we make a function call there are some input registers and some output registers. If function F() is calling function G(), we can make the caller function F()'s output registers the same as the called procedure G()'s input registers this is done using overlapping register windows.This will reduce the memory accesses so that F()'s output need not be put into memory for G() to access again from memory.
II is false as register saves and restores would still be required for each and every variable.
III is also false as instruction fetch is not affected by memory access using multiple register windows.
II is false as register saves and restores would still be required for each and every variable.
III is also false as instruction fetch is not affected by memory access using multiple register windows.
Question 5 |
Which of the following are true?
I.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
II.Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being implemented has nesting of procedures/functions
III.Recursion in programming languages cannot be implemented with dynamic storage allocation
IV.Nesting procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records
V.Programming languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records
II and V only | |
I, III and IV only
| |
I, II and V only
| |
II, III and V only |
Question 5 Explanation:
II. Multilevel access link (or display) arrangement is needed to arrange Activation Records only if the programming language being implemented has nesting of procedures and functions.
V. PL’s which permits a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records.
II & V are True.
V. PL’s which permits a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records.
II & V are True.
Question 6 |
Which of the following statements is FALSE?
In statically typed languages, each variable in a program has a fixed type | |
In un-typed languages, values do not have any types | |
In dynamically typed languages, variables have no types | |
In all statically typed languages, each variable in a program is associated with values of only a single type during the execution of the program
|
Question 6 Explanation:
Dynamic typed languages are those languages in which variable must necessarily be defined before they are used. Then dynamic typed languages have types.
Question 7 |
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statically linked libraries?
Smaller sizes of executable files
| |
Lesser overall page fault rate in the system
| |
Faster program startup
| |
Existing programs need not be re-linked to take advantage of newer versions of libraries |
Question 7 Explanation:
Dynamic link libraries takes more time in program setup (in loading and linking phase to set up the global offset table and load and link the required libraries).
Question 8 |
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?
Assembler | |
Linker | |
Loader | |
Compiler |
Question 8 Explanation:
In many operating system loader is permanently resident in memory.
Some OS may allow virtual memory may allow the loader to be located in a region of memory that is in page table.
Some OS may allow virtual memory may allow the loader to be located in a region of memory that is in page table.
Question 9 |
A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which one of the following is true?
A compiler using static memory allocation can be written for L | |
A compiler cannot be written for L; an interpreter must be used | |
A compiler using dynamic memory allocation can be written for L | |
None of the above |
Question 9 Explanation:
Compiler is use dynamic memory allocation then the memory will be allocated to an array at runtime.
Question 10 |
Heap allocation is required for languages
that support recursion | |
that support dynamic data structures | |
that use dynamic scope rules | |
None of the above |
Question 10 Explanation:
Heap allocation is required for languages that support dynamic data structures.
Question 11 |
A linker is given object modules for a set of programs that were compiled separately. What information need to be included in an object module?
Object code | |
Relocation bits | |
Names and locations of all external symbols defined in the object module
| |
Absolute addresses of internal symbols
|
Question 11 Explanation:
In object module it includes names and locations of all external symbols defined in the object module.
To link to external symbols it must know the location of external symbols.
To link to external symbols it must know the location of external symbols.
Question 12 |
The process of assigning load addresses to the various parts of the program and adjusting the code and date in the program to reflect the assigned addresses is called
Assembly | |
Parsing | |
Relocation | |
Symbol resolution |
Question 12 Explanation:
Relocation can change the assigned address of data and code in the program.
There are 12 questions to complete.