Operating System

Operating System

Operating System
| Operating System |
Q.1
Which one of the following is TRUE for any simple connected undirected graph with more than 2 vertices?
A. No two vertices have the same degree
B. At least two vertices have the same degree
C. At least three vertices have the same degree
D. All vertices have the same degree
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
A CPU generally handles an interrupt by executing an interrupt service routine
A. as soon as an interrupt is raised
B. by checking the interrupt register at the end of fetch cycle
C. by checking the interrupt register after finishing the execution of the current instruction
D. by checking the interrupt register at fixed time intervals
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
The essential content(s) in each entry of a page table is/are
A. Virtual page number
B. Page frame number
C. Both virtual page number and page frame number
D. access right information
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
Match all items in Group I with correct options from those given in Group 2 
   Group 1                                     Group 2
P. Regular expression             1. Syntax analysis 
Q. Pushdown automata          2. Code generation 
R. Dataflow analysis               3. Lexical analysis 
S. Register allocation              4. Code Optimization
Codes: 
A. P-4, Q-1, R-2, S-3
B. P-3, Q-1, R-4, S-2
C. P-3, Q-4, R-1, S-2
D. P-2, Q-1, R-4, S-3
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5
 Which of the following statements are CORRECT?
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 D
Explaination / 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.

Workspace
Report
Q.6
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 B
Explaination / 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.

Workspace
Report
Q.7
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 D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8
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 A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9
In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state:

Now consider the following statements: 
I. If a process makes a transition D, it would result in another process making transition A immediately 
II. A process P2 in blocked state can take transition E while another process P1 is in running state 
III. The OS uses preemptive scheduling 
IV. The OS uses non-preemptive scheduling 
Which of the above statements are TRUE?
A. I and II
B. I and III
C. II and III
D. II and IV
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
The enter_CS( ) and leave_CS( ) functions to implement critical section of a process are realized using test-and-set instruction as follows:
void enter_CS ( X)
{
while (test-and-set (X))
}
void leave_CS (X)
{
X = 0;
}
In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements 
I. The above solution to CS problem is deadlock-free 
II. The solution is starvation free 
III. The processes enter CS in FIFO order 
IV. More than one process can enter CS at the same time 
Which of the above statements are TRUE?
A. I only
B. I and II
C. II and III
D. IV only
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report