Explore topic-wise MCQs in OPERATING SYSTEMS.

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.

51.

A file system with 300 Gbyte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 byte and the size of each disk block address is 8 byte. The maximum possible file system is

A. 3 kbyte
B. 35 kbyte
C. 280 kbyte
D. dependent on the size of the disk
Answer» C. 280 kbyte
52.

Consider the virtual page reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames which are initially empty. Let LRU FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then,

A. OPTIMAL < LRU < FIFO
B. OPTIMAL < FIFO < LRU
C. OPTIMAL = LRU
D. OPTIMAL = FIFO
Answer» C. OPTIMAL = LRU
53.

Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is _________.

A. 7
B. 11
C. 17
D. 0
Answer» B. 11
54.

In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?

A. I and III only
B. II only
C. III only
D. II and III only
Answer» E.
55.

Suppose the time to service a page fault is on the average 10 ms, while a memory access takes 1 ms. Then, a 99.99% hit ratio result in average memory access time of

A. 1.9999 ms
B. 1 ms
C. 9.999 ms
D. 1.9999 ms
Answer» E.
56.

Which combination of the following features will suffice to characterize an operating system as a multi-programmed operating system?

A. (A) only
B. (A) and (B)
C. (A) and (C)
D. (A), (B) and (C)
Answer» C. (A) and (C)
57.

The optimal page replacement algorithm will select the page that

A. has not been used for the longest time in the past
B. will not be used for the longest time in the future
C. has been used least number of times
D. has been used most number of times
Answer» C. has been used least number of times
58.

Consider a system with a two-level paging scheme in which a regular memory access takes 150 ns and servicing a page fault takes 8 ms. An average instruction takes 100 ns of CPU time, and two memory accesses. The TLB hit ratio is 90%, and the page fault rate is one in every 10,000 instructions. What is the effective average instruction execution time?

A. 645 ns
B. 1050 ns
C. 1215 ns
D. 1230 ns
Answer» E.
59.

The atomic fetch-and-set x, y instruction unconditionally sets the memory location x to 1 and fetches the old value of x in y without allowing any intervening access to the memory location x. Consider the following implementation of P and V functions on a binary semaphore S.

A. The implementation may not work, if context switching is disabled in P
B. Instead of using fetch-and-set, a pair of normal load/ store can be used
C. The implementation of V is wrong
D. The code does not implement a binary semaphore
Answer» B. Instead of using fetch-and-set, a pair of normal load/ store can be used
60.

Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur

A. zero
B. 1
C. 2
D. 3
Answer» D. 3
61.

If optimal page replacement policy is used, how many page faults occur for the above reference string?

A. 7
B. 8
C. 9
D. 10
Answer» B. 8
62.

In which one of the following page replacement policies, Belady s anomaly may occur?

A. FIFO
B. Optimal
C. LRU
D. MRU
Answer» B. Optimal
63.

A system uses FIFO policy for page replacement. It has 4 frames with no page loaded to begin with. The system first accesses 100 distinct pages in same order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?

A. 196
B. 192
C. 197
D. 195
Answer» B. 192
64.

The size of the cache tag directory is

A. 160 kbit
B. 136 kbit
C. 40 kbit
D. 32 kbit
Answer» B. 136 kbit
65.

The number of bits in the tag field of an address is

A. 11
B. 14
C. 16
D. 27
Answer» D. 27
66.

Fetch_And_Add (X, i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.

A. fails as L can overflow
B. fails as L can take on a non-zero value that lock is actually available
C. works correctly but may starve some processes
D. works correctly without starvation
Answer» C. works correctly but may starve some processes
67.

Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is ___________.

A. 21 ms
B. 72 ms
C. 12 ms
D. 122 ms
Answer» E.
68.

A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?

A. 3
B. 6
C. 9
D. 15
Answer» C. 9
69.

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2,..., 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?

A. Least-recently-used
B. First-in-first-out
C. Last-in-first-out
D. Most-recently-used
Answer» E.
70.

Consider six memory partitions of sizes 200 KB, 400KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?

A. 200 KB and 300 KB
B. 200 KB and 250 KB
C. 250 KB and 300 KB
D. 300 KB and 400 KB
Answer» B. 200 KB and 250 KB
71.

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.

A. 16
B. 6
C. 64
D. 36
Answer» E.
72.

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 _______.

A. 11
B. 12
C. 22
D. 121
Answer» D. 121
73.

Consider a system with byte addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ______.

A. 84 mB
B. 2 mB
C. 10 mB
D. 4 mB
Answer» E.
74.

Consider a computer system with ten physical page frames. The system is provided with an access sequence (a

A. 1
B. 2
C. 3
D. 4
Answer» B. 2
75.

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 perprocess page table is _________ megabytes.

A. 34 MB
B. 1024 MB
C. 24 MB
D. 384 MB
Answer» E.
76.

Consider a 2-way set associative cache with 256 blocks and uses LRU replacement. Initially the cache is empty. Conflict misses are those misses which occur due to contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of accesses to memory blocks (0, 128, 256, 128, 0, 128 ,256, 128, 1, 129, 257, 129, 1, 129, 257, 129) is repeated 10 times. The number of conflict misses experienced by the cache is ________.

A. 111
B. 27
C. 76
D. 98
Answer» D. 98
77.

Recall that Belady s anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

A. S1 is true, S2 is true
B. S1 is true, S2 is false
C. S1 is false. S2 is true
D. SI is false. S2 is false
Answer» C. S1 is false. S2 is true
78.

Consider a set of n tasks with known runtimes r

A. Round Robin
B. Shortes Jobs First
C. Highest Response Ratio Next
D. First Come First Served
Answer» C. Highest Response Ratio Next
79.

Which of the following scheduling algorithms is non-pre-emptive?

A. Round Robin
B. First-in-First out
C. Multilevel Queue Scheduling
D. Multilevel Queue Scheduling with Feedback
Answer» C. Multilevel Queue Scheduling
80.

The following are the starting and ending times of activities A, B, C, D, E, F, G and H respectively in chronological order:

A. 3
B. 4
C. 5
D. 6
Answer» C. 5
81.

A uni-processor computer system only has two processes, both of which alternate 10 ms CPU bursts with 90 ms IN/ OUT bursts. Both the processes were created at nearly the same time. The IN/OUT of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization (over a long period of time) for this system?

A. First come first served scheduling
B. Shortest remaining time first scheduling
C. Static priority scheduling with defferen priorities for the two processes
D. Round robin scheduling with a time quantum of 5 ms
Answer» E.
82.

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 First (SSTF), claimed by the vendor to give 50% better benchmark results, what is the expected improvement in the IN/OUT performance of user programs?

A. 50%
B. 40%
C. 25%
D. 0%
Answer» E.
83.

What is the maximum profit earned?

A. 147
B. 165
C. 167
D. 175
Answer» B. 165
84.

Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each process spends the first 20% of execution time doing IN/ OUT, the next 70% of time doing computation, and the last 10% of the time doing IN/OUT again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked an IN/OUT or when the running process finishes its compute burst. Assume that all IN/OUT operations can be overlapped as much as possible. For what percentage of time does the CPU remain idle?

A. 0%
B. 10.6%
C. 30.0%
D. 89.4%
Answer» C. 30.0%
85.

Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the Longest Remaining Time First (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is

A. 13 unit
B. 14 unit
C. 15 unit
D. 16 unit
Answer» B. 14 unit
86.

Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively. How many context switches are needed, if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
87.

Consider the following table of arrival time and burst time for three processes P

A. 5.0 ms
B. 4.33 ms
C. 6.33 ms
D. 7.33 ms
Answer» B. 4.33 ms
88.

A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler reevaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?

A. This algorithm is equivalent to the first-comefirst-serve algorithm
B. This algorithm is equivalent to the round-robin algorithm
C. This algorithm is equivalent to the shortest-job-first algorithm
D. This algorithm is equivalent to the shortestremaining-time-first algorithm
Answer» C. This algorithm is equivalent to the shortest-job-first algorithm
89.

Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires t

A. 10
B. 100
C. 1000
D. 500
Answer» D. 500
90.

Consider a uni processor system executing three tasks T

A. 23
B. <img src="http://images.interviewmania.com/wp-content/uploads/2019/11/as-150.jpg">
C. 7
D. 21
Answer» C. 7
91.

Consider the set of processes with arrival time (in milliseconds). CPU burst time (in milliseconds) and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.

A. 9 ms
B. 11 ms
C. 19 ms
D. 29 ms
Answer» E.
92.

Which of the following is not a valid deadlock prevention scheme?

A. Release all resources before requesting a new resource
B. Number the resources uniquely and never request a lower numbered resource than the last one requested
C. Never request a resource after releasing any resource
D. Request and all required resources be allocated before execution
Answer» D. Request and all required resources be allocated before execution
93.

Which one of the following rectifies the problem in the implementation?

A. Lines 6 to 10 are simply replaced by process arrived
B. At the beginning of the barrier the first process to enter the barrier waits until process_arrived becomes zero before proceeding to execute P(S)
C. Context switch is disabled at the beginning of the barrier and re-enabled at the end
D. The variable process_left is made private instead of shared
Answer» C. Context switch is disabled at the beginning of the barrier and re-enabled at the end
94.

The above implementation of barrier is incorrect. Which one of the following is true?

A. The barrier implementation is wrong due to the use of binary semaphore S
B. The barrier implementation may lead to a deadlock, if two barrier invocations are used in immediate succession
C. Lines 6 to 10 need not be inside a critical section
D. The barrier implementation is correct, if there are only two processes instead of three
Answer» C. Lines 6 to 10 need not be inside a critical section
95.

Which of the following is not true for deadlock prevention and deadlock avoidance schemes?

A. In deadlock prevention, the request for resources is always granted, if the resulting state is safe
B. In deadlock avoidance, the request for resources is always granted, if the resulting state is safe
C. Deadlock avoidance is less restrictive than deadlock prevention
D. Deadlock avoidance requires knowledge of resource requirement a priori
Answer» B. In deadlock avoidance, the request for resources is always granted, if the resulting state is safe
96.

A system has n resources R

A. n = 40, k = 26
B. n = 21, k = 12
C. n = 20, k = 10
D. n = 41, k = 19
Answer» C. n = 20, k = 10
97.

Consider the following policies for preventing deadlock in a system with mutually exclusive resources.

A. Any one of i and iii but not ii or iv
B. Any one of i, iii, and iv but not ii
C. Any one of ii, and iii but not i or iv
D. Any one of i, ii, iii, and iv
Answer» E.
98.

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:

A. Safe, Deadlocked
B. Safe, Not Deadlocked
C. Not Safe, Deadlocked
D. Not Safe, Not Deadlocked
Answer» C. Not Safe, Deadlocked
99.

Consider Peterson s algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below.

A. flag [j] = true and turn = i
B. flag [j] = true and turn = j
C. flag [j] = true and turn = j
D. flag [j] = true and turn = i
Answer» C. flag [j] = true and turn = j
100.

Which of the following will ensure that the output string never contains a substring of the form 01

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 and T initially 1
C. P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
D. V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1
Answer» D. V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1