Operating System | Gate-2015| Previous year question|Set-6

Set-15 Operating System Questions

Operating System | Gate-2015|

1. The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently. [GATE – 2015]

P1()
{
   C = B – 1;
   B = 2*C; 
}
 
P2()
{
   D = 2 * B;
   B = D – 1;
}

The number of distinct values that B can possibly take after the execution is      

a. 3
b. 4
c. 5
d. 6

Answer : a)


2. Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of ______________ milliseconds. [GATE – 2015]

a. 13
b. 14
c. 12
d. 15

Answer : c)


3. Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is _________ tracks. [GATE – 2015]

a. 12
b. 13
c. 15
d. 10

Answer : d)


4. Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First-In-First Out (FIFO) and Least Recently Used (LRU)? [GATE – 2015]

a. FIFO incurs 2 more page faults than LRU
b. Both incur the same number of page faults
c. FIFO incurs 1 more page faults than LRU
d. LRU incurs 2 more page faults than FIFO

Answer : b)


5. A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock? [GATE – 2015]

a. 2
b. 3
c. 5
d. 6

Answer : d)


6. A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. The minimum length of the TLB tag in bits is _________. [GATE – 2015]

a. 22
b. 23
c. 24
d. 25

Answer : a)


7. A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is ________ bits.   [GATE – 2015]

a. 37
b. 38
c. 36
d. 39

Answer : c)


8. The maximum number of processes that can be in Ready state for a computer system with n CPUs is : [GATE – 2015]

a. n
b. n2
c. 2n
d. Independent of n

Answer : d)


9. Consider the following policies for preventing deadlock in a system with mutually exclusive resources. [GATE – 2015]

I. Processes should acquire all their resources at the beginning of execution.  If any resource is not 
   available, all resources acquired so far are released.
II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing
    resource numbers.
III. The resources are numbered uniquely, and processes are allowed to request  for resources only in decreasing
     resource numbers.
IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger
    than its currently held resources.

Which of the above policies can be used for preventing deadlock?

a. Any one of I and III but not II or IV
b. Any one of I, II, III, and IV p
c. Any one of II and III but not I or IV
d. Any one of I, III, and IV but not II

Answer : b)
Operating System | Gate-2015|


10. For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time? [GATE – 2015]

ProcessArrival TimeProcessing Time
A03
B16
C44
D62

a. First Come First Serve
b. Round Robin with Quantum value two
c. Shortest Remaining Time
d. Non-preemptive Shortest Job First

Answer : c)
Operating System | Gate-2015|


Back to GATE-HOME


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *