1) Static allocation of all data areas by a compiler makes it impossible to implement
recursion.
2) Automatic garbage collection is essential to implement recursion.
3) Dynamic allocation of activation records is essential to implement recursion.
4) Both heap and stack are essential to implement recursion.
A. 1 and 2 only
B. 2 and 3 only
C. 3 and 4 only
D. 1 and 3 only
Answer : Option DExplaination / Solution:
To implement recursion, activation record should be implemented by providing dynamic
memory allocation. This dynamic allocation is done from runtime stack. Heap is essential to
allocate memory for data structures at run-time, not for recursion.
So statement 1 and 3 are correction.
In the context of modular software design, which one of the following combinations is
desirable?
A. High cohesion and high coupling
B. High cohesion and low coupling
C. Low cohesion and high coupling
D. Low cohesion and low coupling
Answer : Option BExplaination / Solution:
Cohesion is a measure of internal strength within a module, whereas coupling is a measure of
inter dependency among the modules. So in the context of modular software design there
should be high cohesion and low coupling.
Consider a 4-way set associative cache (initially empty) with total 16 cache blocks. The main memory
consists of 256 blocks and the request for memory blocks is in the following order:
0,255,1,4,3,8,133,159,216,129,63,8,48,32, 73, 92,155
Which one of the following memory block will not be in cache if LRU replacement policy is used?
A. 3
B. 8
C. 129
D. 216
Answer : Option DExplaination / Solution: No Explaination.
Consider a system with 4 types of resources R1 (3 units), R2 (2 units),
R3 (3 units), R4 (2 units).
A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained
if it cannot be completely satisfied. Three processes P1,P2,P3 request the resources as follows if executed independently.
Which one of the following statements is TRUE if all three processes run concurrently starting at time t
= 0?
A. All processes will finish without any deadlock
B. Only P1 and P2 will be in a deadlock
C. Only P1 and P3 will be in deadlock
D. All three processes will be in deadlock
Answer : Option AExplaination / Solution: No Explaination.