Test 2 - Operating System | Computer Science (CS)
GATE Previous year Topic Wise Solution | Operating System
Questions
Which of the following statements is false?
- Virtual memory implements the translation of a program's address space into physical memory address space.
- Virtual memory allows each program to exceed the size of the primary memory.
- Virtual memory increases the degree of multi-programming
- Virtual memory reduces the context switching overhead.
Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in main memory will
- always decrease the number of page faults
- always increase the number of page faults
- sometimes increase the number of page faults
- never affect the number of page faults
Where does the swap space reside?
- RAM
- Disk
- ROM
- On-chip cache
Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size is 4 KB, what is the approximate size of the page table?
- 16 MB
- 8 MB
- 2 MB
- 24 MB
Which of the following scheduling algorithms is non-preemptive?
- Round Robin
- First-In First-Out
- Multilevel Queue Scheduling
- Multilevel Queue Scheduling with Feedback
Consider a set of n tasks with known runtimes, r1, r2, ........r3 to be run on a uniprocessor machine. Which of the following processor scheduling algorithms will result in the maximum throughput?
- Round-robin
- Shortest-Job-First
- Highest-Response-Ratio-Next
- First-come-First-Served
The optimal page replacement algorithm will select the page that
- has not been used for the longest time in the past
- will not be used for the longest time in the future
- has been used least number of times
- has been used most number of times
Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j . The program executed by process is shown below.

For the program to guarantee mutual exclusion, the predicate P in the while loop should be
- flag [j]= true and turn =j
- flag [j]=true and turn =j
- flag [i]=true and turn=j
- flag [i]=true and turn=i
In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on
- the size of the blocks, and the size of the address of the blocks
- the number of blocks used for the index, and the size of the blocks
- the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks
- none of the above
The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by
- the instruction set architecture
- page size
- physical memory size
- number of processes in memory
Which combination of the following features will suffice to characterize an OS as a multi-programmed OS ?
More than one program may be loaded into main memory at the same time for execution.
(B) If a program waits for certain events such as I/O, another program is immediately scheduled for execution.
(C) If the execution of a program terminates, another program is immediately scheduled for execution.
- A
- A and B
- A and C
- A, B and C
Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head scheduling algorithm used is First Come First Served (FCFS). If FCFS is replaced by shortest seek Time Fist (SSTF), claimed by the vendor to given 50% better benchmark results, what is the expected improvement in the I/O performance of user programs?
- 50%
- 40%
- 25%
- 0%
A Unix-style I-node has 10 direct pointers and one single, one double and one triple indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits and 48-bit integers are used. What is the maximum possible file size?
- 224 bytes
- 232 bytes
- 234 bytes
- 248 bytes
Consider a system with a two-level paging scheme in which a regular memory access takes 150 nanoseconds, and servicing a page fault takes 8 milliseconds. An average instruction takes 100 nanoseconds of CPU time, and two memory accesses. The TLB hit ratio is 99%, and the page fault rate is one in every 10,000 instructions. What is the effective average instruction execution time?
- 645 nanoseconds
- 1050 nanoseconds
- 1215 nanoseconds
- 1230 nanoseconds
Consider the following statements with respect to user-level threads and kernel-supported threads
(i) Context which is faster with kernel-supported threads
(ii) For user-level threads. a system call can block the entire process
(iii) Kernel-supported threads can be scheduled independently
(iv) User-level threads are transparent to the kernel
Which of the above statements are true?
- (ii),(iii) and (iv) only
- (ii) and (iii) only
- (i) and (iii) only
- (i) and (ii) only
Consider the following set of processes, with the arrival time and the CPU-burst time given in milliseconds.


What is the average turnaround time for these processes using the algorithm shortest remaining processing time first (SRPT)?
- 5.50
- 5.75
- 6.00
- 6.25
Consider the following code fragment:
if (fork()==0
{a = a + 5; print f (%d,%/na, and a);}
else {a − 5; print f (%d,%d/n,a,&a);}
Let u, v be the values printed by the parent process, and x,y be the values printed by the child process. Which one of the following is TRUE?
- u = x + 10 and v = y
- u = x + 10 and v $\ne$ y
- u + 10= x and v = y
- u + 10 = x and v $\ne$ y
Suppose $n$ processes, $P_1, \dots P_n$ share $m$ identical resource units, which can be reserved and released one at a time. The maximum resource requirement of process $P_i$ is $s_i$, where $s_i > 0$. Which one of the following is a sufficient condition for ensuring that deadlock does not occur?
- $\forall i,\: s_i, < m$
- $\forall i, \:s_i < n $
- $\Sigma_{i=1}^n \: s_i < (m+n)$
- $\Sigma_{i=1}^n \: s_i < (m \times n)$
Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores Sx and Sy respectively, both initialized to 1. P and V denote the usual semaphore operators, where P decrements the semaphore value and V increments the semaphore value. The pseudo-codes of P1 and P2 are as follows:

In order to avoid deadlock, the correct operators at L1,L2,L3 and L4 are respectively
- P(SY),P(SX);P(SX),P(SY)
- P(SX),P(SY);P(SY),P(SX)
- P(SX),P(SX);P(SY),P(SY)
- P(SX),P(SY);P(SX),P(SY)




