

MCQOPTIONS
Saved Bookmarks
This section includes 130 Mcqs, each offering curated multiple-choice questions to sharpen your OPERATING SYSTEMS knowledge and support exam preparation. Choose a topic below to get started.
101. |
Which of the following will always lead to an output string with 001100110011 ? |
A. | P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1 |
B. | P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S initially 1, and T initially 0 |
C. | P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1 |
D. | P(S) at W, V(T) at X, P(T) at Y, V(T) at Z, S initially 1, and T initially 0 |
Answer» C. P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1 | |
102. |
Two processes P |
A. | it does not ensure mutual exclusion |
B. | it does not ensure bounded waiting |
C. | it requires that processes enter the critical section in strict alternation |
D. | it does not prevent deadlocks, but ensures mutual exclusion |
Answer» E. | |
103. |
The P and V operations on counting semaphores, where s is a counting semaphore, and defined as follows P(s): s = s 1; |
A. | 0 and 0 |
B. | 0 and 1 |
C. | 1 and 0 |
D. | 1 and 1 |
Answer» D. 1 and 1 | |
104. |
Three concurrent processes, X, Y and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e. wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the P operation on semaphores c, d and a before entering the respective code segments. After completing the execution of its code segment, each process invokes the V operation (i.e. signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes? |
A. | X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a) |
B. | X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d) |
C. | X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d) |
D. | X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a) |
Answer» C. X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d) | |
105. |
Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes |
A. | The proposed solution prevents deadlock but fails to guarantee mutual exclusion |
B. | The proposed solution guarantees mutual exclusion but fails to prevent deadlock |
C. | The proposed solution guarantees mutual exclusion and prevents deadlock |
D. | The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion |
Answer» B. The proposed solution guarantees mutual exclusion but fails to prevent deadlock | |
106. |
Consider the intermediate code given below. |
A. | 5 and 7 |
B. | 6 and 7 |
C. | 5 and 5 |
D. | 7 and 8 |
Answer» C. 5 and 5 | |
107. |
Consider the following two-process synchronization solution: |
A. | This is a correct two-process synchronization solution. |
B. | This solution violates mutual exclusion requirement. |
C. | This solution violates progress requirement. |
D. | This solution violates bounded wait requirement. |
Answer» D. This solution violates bounded wait requirement. | |
108. |
Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O |
A. | guarantee serializability and deadlock-freedom |
B. | guarantee neither serializability nor deadlock-freedom |
C. | guarantee serializability but not deadlock-freedom |
D. | guarantee deadlock-freedom but not serializability |
Answer» B. guarantee neither serializability nor deadlock-freedom | |
109. |
Consider the following proposed solution for the critical section problem. There are n processes: P |
A. | At most one process can be in the critical section at any time. |
B. | The bounded wait condition is satisfied. |
C. | The progress condition is satisfied. |
D. | It cannot cause a deadlock. |
Answer» B. The bounded wait condition is satisfied. | |
110. |
Using a larger block size in a fixed block size file system leads to |
A. | better disk throughput but poorer disk space utilization |
B. | better disk throughput and better disk space utilization |
C. | poorer disk throughput but better disk space utilization |
D. | poorer disk throughput and poorer disk space utilization |
Answer» B. better disk throughput and better disk space utilization | |
111. |
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 bit, and 48-bit integers are used. What is the maximum possible file size? |
A. | 224 byte |
B. | 232 byte |
C. | 234 byte |
D. | 248 byte |
Answer» D. 248 byte | |
112. |
Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence 4, 34, 10, 7, 19, 73, 2, 15, 6, 20 Assuming that the head is currently at cylinder 50, what is the time taken to satisfy requests, if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first policy is used? |
A. | 95 ms |
B. | 119 ms |
C. | 233 ms |
D. | 276 ms |
Answer» C. 233 ms | |
113. |
Threads of a process share |
A. | global variables but nor heap. |
B. | heap but nor global variables. |
C. | neither global variables nor heap. |
D. | both heap and global variables. |
Answer» E. | |
114. |
A process executes the code |
A. | 3 |
B. | 4 |
C. | 7 |
D. | 8 |
Answer» D. 8 | |
115. |
The enter _CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows |
A. | 1 only |
B. | 1 and 2 |
C. | 2 and 3 |
D. | 4 only |
Answer» B. 1 and 2 | |
116. |
Consider the following statements about user level threads and kernel level threads : |
A. | Context switch time is longer for kernel level threads than for user level threads |
B. | User level threads do not need any hardware support |
C. | Related kernel level threads can be scheduled on different processors in a multi-processor system |
D. | Blocking one kernel level thread blocks all related threads |
Answer» E. | |
117. |
An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10 ms. Rotational speed of disk is 6000 rpm. If all 100 libraries are loaded from random location on the disk, how long does it take to load all libraries? The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected? |
A. | 0.50 s |
B. | 1.50 s |
C. | 1.25 s |
D. | 1.00 s |
Answer» C. 1.25 s | |
118. |
A shared variable x, initialised to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by one, stores it to memory and then terminates. Each of the processes Y and Z reads x from memory, decrements by two, stores it to memory and then terminates. Each process before reading x invokes the P operation (i.e. wait) on a counting semaphore S and invokes the V operation (i.e. signal) on the semaphore S after storing x to memory. Semaphore S is initialised to two. What is the maximum possible value of x after all processes complete execution? |
A. | 2 |
B. | 1 |
C. | 1 |
D. | 2 |
Answer» E. | |
119. |
Consider a typical disk that rotates at 150000 Rotations Per Minute (RPM) and has a transfer rate of 50 106 bytes/sec. If the average seek time of the disk is twice the average rotation delay and the controller's transfer time is 10 times the disk transfer time, the average time (in milliseconds) to read or write a 512-byte sector of the disk is _____. |
A. | 6 ms |
B. | 111 ms |
C. | 16.1 ms |
D. | 6.1 ms |
Answer» E. | |
120. |
A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e, if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are : |
A. | x = 1, y = 2 |
B. | x = 2, y = l |
C. | x = 2, y = 2 |
D. | x = l, y = 1 |
Answer» D. x = l, y = 1 | |
121. |
Which of the following is/are shared by all the threads in a process? |
A. | I and II only |
B. | III only |
C. | IV only |
D. | III and IV only |
Answer» C. IV only | |
122. |
A thread is usually defined as a light weight process because an Operating System (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is true? |
A. | On perthread basis, the operating system maintains only CPU register state |
B. | The operating system does not maintain a separate stack for each thread |
C. | On perthread basis, the operating system does not maintain virtual memory state |
D. | On per thread basis, the operating system maintains only scheduling and accounting information. |
Answer» B. The operating system does not maintain a separate stack for each thread | |
123. |
Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 Rotations Per Minute (RPM). It has 60 sectors per track and each sector can store 512 bytes of data. Consider a file stored in the disk. The file contains 2000 sectors. Assume that every sector access necessitates a seek, and the average rotational latency for accessing each sector is half of the time for one complete rotation. The total time (in milliseconds) needed to read the entire file is _______. |
A. | 11020 ms |
B. | 7020 ms |
C. | 14020 ms |
D. | 140 ms |
Answer» D. 140 ms | |
124. |
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. | 10 |
B. | 50 |
C. | 100 |
D. | 5 |
Answer» B. 50 | |
125. |
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. | 165 |
B. | 16 |
C. | 5 |
D. | None of these |
Answer» B. 16 | |
126. |
Consider the following code segment : |
A. | 5 |
B. | 10 |
C. | 100 |
D. | 11 |
Answer» C. 100 | |
127. |
Consider the following statements with respect to userlevel threads and kernel-supported threads: |
A. | 2, 3 and 4 |
B. | 2 and 3 |
C. | 1 and 3 |
D. | 1 and 2 |
Answer» B. 2 and 3 | |
128. |
Consider the following code fragment : |
A. | u = x + 10 and v = y |
B. | u = x + 1 and v y |
C. | u + 10 = x and v = y |
D. | u + 10 = x and v y |
Answer» D. u + 10 = x and v y | |
129. |
Consider a machine with 64 Mbyte physical memory and a 32-bit virtual address space. If the page size is 4 kbyte, what is the approximate size of the page table? |
A. | 16 Mbyte |
B. | 8 Mbyte |
C. | 2 Mbyte |
D. | 24 Mbyte |
Answer» D. 24 Mbyte | |
130. |
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 |
A. | always decrease the number of page faults |
B. | always increase the number of page faults |
C. | sometimes increase the number of page faults |
D. | never affect the number of page faults |
Answer» D. never affect the number of page faults | |