Operating System MCQs

An operating system is system software that manages computer hardware and software resources and provides general services for computer programs. Some operating system examples include macOS, Microsoft Windows, Google’s Android OS, Linux Operating System, Apple iOS, etc.

MCQs on Operating Systems

Practise MCQ questions of Operating Systems (OS) to prepare better for your GATE exam. We would also urge the aspirants to practise GATE previous years’ question papers to understand the pattern of multiple-choice questions for OS. Meanwhile, here is a list of questions that would help you practise the same:

Operating System MCQ Questions

1. In the case of the index allocation scheme of various blocks to a file, the maximum size (possible) of the file would depend on :

a. the total number of blocks that have been used for the index, size of all the blocks

b. the actual size of all blocks, the size of the blocks’ address

c. the of the blocks’ size, the blocks’ address size, and the total number of blocks that have been used for the index

d. None of the above

Answer: (a) the total number of blocks that have been used for the index, size of all the blocks

2. The swap space in a disk is primarily used to:

a. Save process data

b. Save temporary HTML pages

c. Store the device drivers

d. Store the super-block

Answer: (a) Save process data

3. Out of these page replacement algorithms, which one suffers from Belady’s anomaly?

a. LRU

b. FIFO

c. Both LRU and FIFO

d. Optimal Page Replacement

Answer: (b)FIFO

4. An increase in a computer’s RAM leads to a typical improvement in performance because:

a. Fewer page faults occur

b. Virtual memory increases

c. Fewer segmentation faults occur

d. A larger RAM is faster

Answer: (a) Fewer page faults occur

5. Consider a computer system that supports 32-bit physical as well as virtual addresses. Now since the space of the physical address is the same size as the virtual address, the OS designers would decide to entirely get rid of its virtual memory. Which one of these is true in this case?

a. It is no longer possible to efficiently implement multi-user support

b. It is possible to make CPU scheduling more efficient now

c. There would no longer be a requirement for hardware support for memory management

d. It would be possible to make the processor cache organisation more efficient now

Answer: (c) There would no longer be a requirement for hardware support for memory management

6. The Virtual memory is:

a. An illusion of a large main memory

b. A large main memory

c. A large secondary memory

d. None of the above

Answer: (a) An illusion of a large main memory

7. A CPU yields 32-bit virtual addresses, and the page size is 4 kilobytes. Here, the processor consists of a TLB (translation lookaside buffer). It is a 4-way set associative, and it can hold a total of 128-page table entries. The TLB tag’s minimum size is:

a. 20 bits

b. 15 bits

c. 13 bits

d. 11 bits

Answer: (b) 15 bits

8. Thrashing occurs in a system when:

a. The processes on the system access pages and not memory frequently

b. A page fault pops up

c. The processes on the system are in running state

d. The processes on the system are in the waiting state

Answer: (a) The processes on the system access pages and not memory frequently

9. The page fault occurs whenever:

a. The requested page isn’t in the memory

b. The requested page is in the memory

c. An exception is thrown

d. The page is corrupted

Answer: (a) The requested page isn’t in the memory

10. Consider a computer that uses 32–bit physical address, 46–bit virtual address, along with a page table organisation that is three-level. Here, the base register of the page table stores the T1 (first–level table) base address, which occupies exactly one page. Every entry of the T1 stores the T2 (second-level table) page’s base address. Similarly, every entry of T2 stores the T3 (third-level table) page’s base address and every entry of T3 stores a PTE (page table entry). The size of PTE is 32 bits. In the computer, the processor has a 1 MB 16 way virtually indexed set-associative physically tagged cache. If the size of the cache block is 64 bytes, then what is the size of a page in this computer in Kilobytes?

a. 4

b. 2

c. 16

d. 8

Answer: (d) 8

11. Consider that the page fault service time in a computer is 10ms and the average memory access time is 20ns. If, in case, it generates a page fault every 10^6 memory accesses, then what would be the effective access time for this memory?

a. 30ns

b. 21ns

c. 35ns

d. 23ns

Answer: (a) 30ns

12. FIFO policy is used in a system for page replacement. It consists of 4-page frames, and no pages loaded, to start with. This system initially accesses 100 separate pages in a particular order. It then accesses these same 100 pages. The difference is that now they are in the reverse order. Considering this, how many page faults would occur here?

a. 192

b. 195

c. 196

d. 197

Answer: (c) 196

13. In every entry of a page table, the essential content(s) is/are:

a. Page frame number

b. Virtual page number

c. Both page frame number and virtual page number

d. Accessing the right information

Answer: (a) Page frame number

14. When translating a virtual address to a physical address, a multilevel page table is always a preference as compared to a single level page because it:

a. Helps in the reduction of the total page faults in the page replacement algorithms

b. Reduces the total memory access time for reading or writing a memory location

c. Helps in the reduction of the page table size required for implementing a process’s virtual address space

d. Is required by the lookaside buffer translation

Answer: (c) Helps in the reduction of the page table size required for implementing a process’s virtual address space

15. Consider a processor that uses 32-bit virtual addresses, 36-bit physical addresses, and a 4 KB page frame size. Each page table entry is 4 bytes in size. Here, a page table of three-level is used for the translation of virtual to a physical address. The virtual address, in this case, is used as follows:

• Bits 12-20 are utilised for indexing into the page table of the third level

• Bits 21-29 are utilised for indexing into the page table of the second level

• Bits 30-31 are utilised for indexing into the page table of the first level, and • Bits 0-11 are utilised as an offset within the page.

Thus, the total number of bits needed to address the next level page frame or page table for the first-level, second-level and third-level page table entry are respectively:

a. 25, 25 and 24

b. 24, 24 and 20

c. 24, 24 and 24

d. 20, 20 and 20

Answer: (c) 24, 24 and 24

16. Consider that a virtual memory system uses a FIFO page replacement policy. For a process, it allocates a fixed number of frames. Now consider these statements:

A: An increase in the number of page frames that are allocated to a

process sometimes leads to an increase in the page fault rate.

B: A few programs do not display the locality of reference.

Which one of these statements is TRUE?

a. A is false, but B is true

b. Both A and B are false

c. Both A and B are true, and B is the reason for A

d. Both A and B are true, but B isn’t the reason for A

Answer: (d)Both A and B are true, but B isn’t the reason for A

17. 3 page frames have been allocated to a process. Here, we assume that none of the process’s pages is available initially in the memory, and the process creates this sequence of page references: 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 (reference string). If an optimal page replacement policy is utilised, then how many page faults would occur for the reference string mentioned above?

a. 10

b. 9

c. 8

d. 7

Answer: (d) 7

18. Consider paging hardware that has a TLB. Let us assume that the page table and the pages are in their physical memory. Searching the TLB takes 10 milliseconds, and accessing the physical memory takes 80 milliseconds. In case the TLB hit ratio is 0.6, then the effective memory access time is _________ (in milliseconds).

a. 124

b. 122

c. 120

d. 118

Answer: (b) 122

19. A system that has 32-bit virtual addresses & 1 KB page size, it is not practical to use one-level page tables for translating virtual to a physical address, due to:

a. a large amount of external fragmentation

b. a large amount of internal fragmentation

c. a large computation overhead in the process of translation

d. a large memory overhead when maintaining the page tables

Answer: (d)a large memory overhead when maintaining the page tables

20. Which of these isn’t an advantage of using dynamically linked, shared libraries, as compared to statically linked libraries?

a. Faster program startup

b. The existing programs do not need to be re-linked so as to take advantage of the newer library versions

c. Lesser page fault rate in a system

d. Smaller sizes of executable files

Answer: (a) Faster program startup

21. Out of all the following, which one isn’t a form of memory?

a. translation lookaside buffer

b. instruction opcode

c. instruction register

d. instruction cache

Answer: (b)instruction opcode

22. The process of dynamic linking can generate security concerns because:

a. Linking is insecure

b. The cryptographic procedures aren’t available for the process of dynamic linking

c. Security is dynamic

d. The path of the searching dynamic libraries isn’t known until the runtime

Answer: (b)The cryptographic procedures aren’t available for the process of dynamic linking

23. Which of these is a false statement?

a. The virtual memory translates a program‘s address space into their physical memory address space.

b. The virtual memory allows every program to exceed the primary memory’s size.

c. The virtual memory leads to an increase in the degree of multiprogramming

d. The virtual memory leads to a reduction of the context switching overhead

Answer: (d)The virtual memory leads to a reduction of the context switching overhead

24. ________ is the process in which load addresses are assigned to a program’s various parts, and the code and date are adjusted in the program for the reflection of the assigned addresses.

a. Symbol resolution

b. Assembly

c. Parsing

d. Relocation

Answer: (d)Relocation

25. Which one of these is NOT shared by the same process’s threads?

a. Address Space

b. Stack

c. Message Queue

d. File Descriptor Table

Answer: (b)Stack

26. In the case of a particular Unix OS, every data block is 1024 bytes in size. Every node consists of 10 direct data block addresses along with three additional addresses: one for a triple, one for double, and one for a single indirect block. Each block here can consist of addresses for 128 blocks. Out of the following, which one is the approximate maximum size of the files in a file system?

a. 16 GB

b. 8 GB

c. 2 GB

d. 512 MB

Answer: (c) 2GB

27. Which of these disk scheduling policies results in minimum head movement?

a. Circular scan

b. Elevator

c. FCS

d. None of the above

Answer: (a) Circular scan

28. Consider a hard disk that has 63 sectors/track. It has 10 platters each – 2 recording surfaces & 1000 cylinders. A sector’s address is displayed as a triple (c, h, s). Here, c refers to the cylinder number, h refers to the surface number, and s refers to the sector number. The 0th sector here is addressed as (0, 0, 0), then the 1st sector will be addressed as (0, 0, 1), and so on. According to this, the address (400,16,29) would correspond to the sector number:

a. 505038

b. 505037

c. 505036

d. 505035

Answer: (b)505037

29. In a magnetic disk that consists of concentric circular tracks, its seek latency isn’t proportional linearly to the seek distance, because of:

a. the use of arm scheduling policies that are unfair

b. a higher track capacity on the platter’s periphery

c. a starting and stopping inertia for arms

d. a non-uniform distribution of all the requests

Answer: (c) a starting and stopping inertia for arms

30. Out of the following statements, which ones are NOT true about asynchronous and synchronous I/O?

a. In a synchronous I/O, any process that is waiting for the I/O’s completion is woken up by the Interrupt Service Routine that is invoked after the I/O gets completed.

b. The processes that make the synchronous I/O call wait until I/O gets completed, but the processes that make an asynchronous I/O call don’t wait for the completion of the I/O.

c. In both asynchronous and synchronous I/O, an Interrupt Service Routine (ISR) is invoked after the I/O is finally completed.

d. The ISR is invoked after completing the I/O in synchronous I/O. It does not do so in the case of asynchronous I/O.

Answer: (d) The ISR is invoked after completing the I/O in synchronous I/O. It does not do so in the case of asynchronous I/O.

31. The usage of some larger block size in a file system of a fixed block size leads to:

a. a better disk space utilisation but poorer disk throughput

b. a poorer disk space utilisation and poorer disk throughput

c. a poorer disk space utilisation but better disk throughput

d. a better disk space utilisation and better disk throughput

Answer: (c) a poorer disk space utilisation but better disk throughput

32. Out of the following, which one needs a device driver?

a. Main memory

b. Disk

c. Register

d. Cache

Answer: (b)Disk

33. The onboard memory of a graphics card is about 1 MB. Out of the modes mentioned below, which one does the card not support?

a. A resolution of 1600 x 400 and a 17-inch monitor with 256 colours.

b. A resolution of 1600 x 400 and a 14-inch monitor with 16 million colours.

c. A resolution of 800 x 400 and a 17-inch monitor with 16 million colours.

d. A resolution of 800 x 800 and a 14-inch monitor with 256 colours.

Answer: (b) A resolution of 1600 x 400 and a 14-inch monitor with 16 million colours.

34. Out of the following interrupt handling mechanisms and DMA transfer modes, which one enables the highest bandwidth for I/O:

a. Polling interrupts and Transparent DMA

b. Vectored interrupts and Cycle-stealing

c. Vectored interrupts and Block transfer

d. Polling interrupts and Block transfer

Answer: (c) Vectored interrupts and Block transfer

35. Assume three processes with process IDs 0, 1, and 2, respectively. They have computed time bursts of 2, 4, and 8 units, and all the processes arrive at time 0. Now consider the LRTF (longest remaining time first) scheduling algorithm. In the case of LRTF, the ties are broken by prioritising the process that has the lowest process ID. Here, the average turnaround time would be:

a. 16 units

b. 15 units

c. 14 units

d. 13 units

Answer: (d)13 units

36. Out of these statements, which ones are/is true?

P. The shortest remaining time in the first scheduling may lead to starvation

Q. Preemptive scheduling may lead to starvation

R. In terms of responsive time, Round robin is comparatively much better than FCFS

a. P only

b. P and R only

c. Q and R only

d. P, Q and R

Answer: (d)P, Q and R

37. An OS utilises the SRT or Shortest Remaining Time first process scheduling algorithm. Let us consider the execution time and arrival time for these processes:

Process Arrival time Execution time

P1 : 0 20

P2 : 15 25

P3 : 30 10

P4 : 45 15

The total waiting time for the P2 process would be:

a. 55

b. 40

c. 15

d. 5

Answer: (c) 15

38. In a computer system that consists of n number of CPUs, the maximum processes that can exist in the Ready State would be:

a. Independent of n

b. 2n

c. n^2

d. n

Answer: (a) Independent of n

39. Out of the following, which one is FALSE about Shortest Job First Scheduling (SJF)?

X1: It can lead to starvation

X2: It can lead to a minimum average waiting time

a. Only X1

b. Only X2

c. Neither X2 nor X1

d. Both X2 and X1

Answer: (c) Neither X2 nor X1

40. In a process, the following code is executed:

fork();

fork();

fork();

As a result, a total of _______ number of child processes will be created.

a. 8

b. 7

c. 4

d. 3

Answer: (b)7

41. The total time taken for switching between the user and the kernel modes of execution is t1, while the total time taken for switching between two processes is t2. Out of the following, which one is TRUE?

a. t2 > t1

b. t2 = t1

c. t2 < t1

d. We cannot say anything about the relation between t2 and t1

Answer: (a) t2 > t1

42. We can define a thread as a “lightweight process”. It is because an OS (operating system) maintains much shorter data structures for a thread instead of a process. Concerning this, which of the following statements is TRUE?

a. The Operating System maintains only the CPU register state on a per-thread basis

b. The OS does not maintain each thread’s separate stack

c. The Operating System does not maintain a virtual memory state on a per-thread basis

d. The Operating System maintains only accounting and scheduling information on a per-thread basis

Answer: (c) The Operating System does not maintain a virtual memory state on a per-thread basis

43. Which one of these statements about kernel-level threads and user-level threads is FALSE?

a. The context switch time is comparatively longer for the kernel-level threads, as compared to the ones for the user-level threads.

b. The user-level threads don’t require any support for hardware.

c. We can schedule the related kernel-level threads in a multi-processor system on different processors.

d. When one kernel-level thread is blocked, then all the related threads will be blocked.

Answer: (d) When one kernel-level thread is blocked, then all the related threads will be blocked.

44. Which of these doesn’t interrupt a running process?

a. Power failure

b. Scheduler process

c. Timer

d. A device

Answer: (b)Scheduler process

45. Which of these need not be saved necessarily during context switching between various processes?

a. Translation look-aside buffer

b. General-purpose registers

c. Program counter

d. None of the above

Answer: (a) Translation look-aside buffer

46. In the case of a working-set strategy, which of these is done by the OS to prevent thrashing?

P. If there are enough extra frames, it initiates another process.

Q. It selects any process for suspending in case the sum of the working sets’ sizes exceed the number of available frames.

a. P only

b. Q only

c. Neither P nor Q

d. Both P and Q

Answer: (d)Both P and Q

47. An OS implements a policy that needs a process to release all of the resources before it makes any requests for another resource. Out of all the statements below, select the one that is TRUE:

a. Both deadlock and starvation can occur

b. Deadlock cannot occur, but starvation can occur

c. Deadlock can occur, but starvation cannot occur

d. Neither deadlock nor starvation can occur

Answer: (b)Deadlock cannot occur, but starvation can occur

48. Multiple words are put in a single cache block for:

a. reducing the miss penalty

b. exploiting the reference’s temporal locality in a program

c. exploiting the reference’s spatial locality in a program

d. none of the above

Answer: (c) exploiting the reference’s spatial locality in a program

49. The lowest number of page frames that are bound to be allocated in an environment of virtual memory to a running process is determined by:

a. the page size

b. the instruction set architecture

c. the total number of processes in memory

d. the size of the physical memory

Answer: (b)the instruction set architecture

50. Consider a file whose ordering key field is 10 bytes long, the primary index has been created for the file, and the block pointer is 6 bytes long. In this case, if we wish to search a record with the help of an index, then how many block access do we require?

a. 11

b. 10

c. 9

d. 8

Answer: (b)10

Keep learning and stay tuned to get the latest updates on the GATE Exam along with Eligibility Criteria, GATE Syllabus for CSE (Computer Science Engineering), GATE CSE Notes, GATE CSE Question Paper, and more.

Leave a Comment

Your Mobile number and Email id will not be published.

*

*