Test 2 - Operating System | Computer Science (CS)

GATE Previous year Topic Wise Solution | Operating System

19 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following statements is false?

  1. Virtual memory implements the translation of a program's address space into physical memory address space.
  2. Virtual memory allows each program to exceed the size of the primary memory.
  3. Virtual memory increases the degree of multi-programming
  4. Virtual memory reduces the context switching overhead.
Question 2 Multiple Choice (Single Answer)

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

  1. always decrease the number of page faults
  2. always increase the number of page faults
  3. sometimes increase the number of page faults
  4. never affect the number of page faults
Question 3 Multiple Choice (Single Answer)

Where does the swap space reside?

  1. RAM
  2. Disk
  3. ROM
  4. On-chip cache
Question 4 Multiple Choice (Single Answer)

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?

  1. 16 MB
  2. 8 MB
  3. 2 MB
  4. 24 MB
Question 5 Multiple Choice (Single Answer)

Which of the following scheduling algorithms is non-preemptive?

  1. Round Robin
  2. First-In First-Out
  3. Multilevel Queue Scheduling
  4. Multilevel Queue Scheduling with Feedback
Question 6 Multiple Choice (Single Answer)

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?

  1. Round-robin
  2. Shortest-Job-First
  3. Highest-Response-Ratio-Next
  4. First-come-First-Served
Question 7 Multiple Choice (Single Answer)

The optimal page replacement algorithm will select the page that

  1. has not been used for the longest time in the past
  2. will not be used for the longest time in the future
  3. has been used least number of times
  4. has been used most number of times
Question 8 Multiple Choice (Single Answer)

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

  1. flag [j]= true and turn =j
  2. flag [j]=true and turn =j
  3. flag [i]=true and turn=j
  4. flag [i]=true and turn=i
Question 9 Multiple Choice (Single Answer)

In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on

  1. the size of the blocks, and the size of the address of the blocks
  2. the number of blocks used for the index, and the size of the blocks
  3. the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks
  4. none of the above
Question 10 Multiple Choice (Single Answer)

The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by

  1. the instruction set architecture
  2. page size
  3. physical memory size
  4. number of processes in memory
Question 11 Multiple Choice (Single Answer)

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.

  1. A
  2. A and B
  3. A and C
  4. A, B and C
Question 12 Multiple Choice (Single Answer)

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?

  1. 50%
  2. 40%
  3. 25%
  4. 0%
Question 13 Multiple Choice (Single Answer)

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?

  1. 224 bytes
  2. 232 bytes
  3. 234 bytes
  4. 248 bytes
Question 14 Multiple Choice (Single Answer)

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?

  1. 645 nanoseconds
  2. 1050 nanoseconds
  3. 1215 nanoseconds
  4. 1230 nanoseconds
Question 15 Multiple Choice (Single Answer)

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?

  1. (ii),(iii) and (iv) only
  2. (ii) and (iii) only
  3. (i) and (iii) only
  4. (i) and (ii) only
Question 16 Multiple Choice (Single Answer)

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)?

  1. 5.50
  2. 5.75
  3. 6.00
  4. 6.25
Question 17 Multiple Choice (Single Answer)

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?

  1. u = x + 10 and v = y
  2. u = x + 10 and v $\ne$ y
  3. u + 10= x and v = y
  4. u + 10 = x and v $\ne$ y
Question 18 Multiple Choice (Single Answer)

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?

  1. $\forall i,\: s_i, < m$
  2. $\forall i, \:s_i < n $
  3. $\Sigma_{i=1}^n \: s_i < (m+n)$
  4. $\Sigma_{i=1}^n \: s_i < (m \times n)$
Question 19 Multiple Choice (Single Answer)

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

  1. P(SY),P(SX);P(SX),P(SY)
  2. P(SX),P(SY);P(SY),P(SX)
  3. P(SX),P(SX);P(SY),P(SY)
  4. P(SX),P(SY);P(SX),P(SY)