Operating System GATE previous year questions with answer

Ques 40 Gate 2016 Set-2


In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?

A

LRU (Least Recently Used)

B

OPT (Optimal Page Replacement)

C

MRU (Most Recently Used)

D

FIFO (First In First Out)


(P) is the correct answer.

Given:
Page replacement algorithms: LRU, OPT, MRU, and FIFO.
Condition: Page fault rate increases even when the number of allocated frames increases.
To find:
The page replacement algorithm that shows this behavior.
Solution:
Okay, I know that this phenomenon is called Belady's Anomaly.
Let me recall which algorithms suffer from Belady's Anomaly.
Stack-based algorithms never exhibit Belady's anomaly because the set of pages in memory for n frames is always a subset of the pages in memory for n + 1 frames.
Both LRU and Optimal (OPT) are stack algorithms, so they never suffer from this issue.
Now looking at FIFO, the First-In-First-Out algorithm does not satisfy the inclusion property.
Because of this, for certain reference strings, increasing the number of page frames actually leads to more page faults in FIFO.
So FIFO is definitely the algorithm that shows this behavior.
Answer: (D) FIFO (First In First Out)

Ques 41 Gate 2016 Set-1


Consider a computer system with ten physical page frames. The system is provided with an access sequence a1, a2, ..., a20, a1, a2, ..., a20), where each ai number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is __________


(a) is the correct answer.

Ques 42 Gate 2016 Set-1


Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is______


(a) is the correct answer.

Ques 43 Gate 2016 Set-1


Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _________megabytes.


(a) is the correct answer.

Ques 44 Gate 2016 Set-1


Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?

A

Shortest remaining time first

B

Round-robin with time quantum less than the shortest CPU burst

C

Uniform random

D

Highest priority first with priority proportional to CPU burst length


(S) is the correct answer.

Given:
An arbitrary set of CPU-bound processes with unequal burst lengths.
All processes arrive at the same time (arrival time t = 0).
To find:
The scheduling algorithm that minimizes the average waiting time in the ready queue.
Solution:
Okay, let's think about which algorithm gives the minimum average waiting time.
I know that Shortest Job First (SJF) is provably optimal for giving the minimum average waiting time among all scheduling algorithms.
Here, it says all processes are submitted at the same time.
When all processes arrive at time t = 0, no new process arrives later with a shorter burst to cause preemption.
So, Shortest Remaining Time First (SRTF), which is the preemptive version of SJF, behaves exactly like non-preemptive SJF.
Both will run the process with the smallest CPU burst first, then the next smallest, and so on.
Let's check the other options to be completely sure.
Option B is Round-robin, which shares the CPU and increases the average waiting time compared to SJF.
Option C is uniform random scheduling, which is clearly not optimal.
Option D assigns higher priority to processes with longer bursts, which turns it into Longest Job First (LJF), giving the worst average waiting time.
Hence, Shortest Remaining Time First gives the minimum average waiting time.
Answer: (A) Shortest remaining time first

Ques 45 Gate 2015 Set-3


The maximum number of processes that can be in Ready state for a computer system with n CPUs is

A

n

B

n2

C

2n

D

Independent of n


(Process) is the correct answer.

PROCESSED

Ques 46 Gate 2015 Set-1


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


(a) is the correct answer.

Ques 47 Gate 2015 Set-1


The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

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) is the correct answer.

Ques 48 Gate 2014 Set-1


Which one of the following statements is FALSE?

A

The TLB performs an associative search in parallel on all its valid entries using the page number of the incoming virtual addresses.

B

If the virtual address of a word given by the CPU has a TLB hit, but the subsequent search for the word results in a cache miss, then the word will always be present in the main memory

C

The memory access time using a given inverted page table is always the same for all incoming virtual addresses.

D

In a system that uses hashed page tables, if two distinct virtual addresses V1 and V2 map to the same value while hashing, then the memory access time of these addresses will not be the same.


(1) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......