Thrashing
1. What is thrashing in an operating system?
o A) Excessive use of CPU resources
o B) High page fault rate leading to excessive paging
o C) Low memory utilization
o D) Increased process execution time
o Answer: B
2. When does thrashing occur?
o A) When a process is waiting for I/O
o B) When the system has too much free memory
o C) When a process does not have enough frames for its active pages
o D) When all pages are in memory
o Answer: C
3. Which of the following best describes the impact of thrashing on system performance?
o A) It increases system throughput
o B) It leads to high CPU utilization
o C) It decreases system efficiency due to high page faulting
o D) It has no impact on performance
o Answer: C
4. Which model is used to manage thrashing?
o A) Locality Model
o B) FIFO Model
o C) Optimal Page Replacement Model
o D) LRU Model
o Answer: A
5. In the working set model, what does a process's locality refer to?
o A) The number of processes it can run
o B) The set of pages that are frequently accessed
o C) The amount of memory allocated to it
o D) The execution time of the process
o Answer: B
Virtual Memory
6. What is the purpose of virtual memory?
o A) To provide a larger memory space than physically available
o B) To reduce the cost of RAM
o C) To allow multiple users to run processes simultaneously
o D) To improve the speed of I/O operations
o Answer: A
7. In virtual memory systems, what does the term 'paging' refer to?
o A) Dividing physical memory into frames
o B) Dividing logical memory into pages
o C) Copying data to secondary storage
o D) Executing multiple processes
o Answer: B
8. Which of the following statements about demand paging is true?
o A) It loads all pages into memory at startup
o B) It loads pages only when they are accessed
o C) It eliminates the need for page replacement
o D) It reduces the complexity of memory management
o Answer: B
9. What is a page fault?
o A) Accessing a page that is currently in memory
o B) Accessing a page that is not in memory
o C) The process of replacing a page
o D) None of the above
o Answer: B
10. What is the purpose of the page table?
o A) To store process execution history
o B) To map virtual addresses to physical addresses
o C) To manage I/O operations
o D) To allocate CPU time to processes
o Answer: B
Page Replacement Algorithms
11. Which page replacement algorithm replaces the oldest page in memory?
o A) Least Recently Used (LRU)
o B) First-In-First-Out (FIFO)
o C) Optimal
o D) Random
o Answer: B
12. What is Belady's anomaly?
o A) When increasing the number of page frames results in a higher page fault rate
o B) When a page fault occurs
o C) When all pages are in memory
o D) When memory allocation is inefficient
o Answer: A
13. Which of the following algorithms is considered optimal?
o A) FIFO
o B) LRU
o C) Optimal Page Replacement
o D) Second Chance
o Answer: C
14. The Least Recently Used (LRU) algorithm replaces:
o A) The page that has been used the least recently
o B) The page that has been in memory the longest
o C) A randomly selected page
o D) The page with the smallest size
o Answer: A
15. The Second Chance page replacement algorithm is a modification of which algorithm?
o A) LRU
o B) FIFO
o C) Optimal
o D) Random
o Answer: B
Segmentation
16. What does segmentation do in memory management?
o A) Divides memory into fixed-size pages
o B) Divides memory into segments based on logical divisions
o C) Combines multiple segments into one
o D) Optimizes disk storage
o Answer: B
17. In segmentation, a logical address is expressed as:
o A) <page number, offset>
o B) <segment number, offset>
o C) <frame number, offset>
o D) <process ID, memory location>
o Answer: B
18. Which of the following is an advantage of segmentation?
o A) No external fragmentation
o B) Simplified memory allocation
o C) Better alignment with user views of processes
o D) Increased internal fragmentation
o Answer: C
19. What is the main disadvantage of segmentation?
o A) Increased internal fragmentation
o B) External fragmentation
o C) Complexity in addressing
o D) Reduced performance
o Answer: B
20. Modern operating systems typically use:
o A) Only paging
o B) Only segmentation
o C) A combination of paging and segmentation
o D) None of the above
o Answer: C
Process Management
21. What is a process in an operating system?
o A) A program in execution
o B) A set of instructions
o C) A type of hardware
o D) A memory allocation unit
o Answer: A
22. Which of the following is a state of a process?
o A) New
o B) Ready
o C) Running
o D) All of the above
o Answer: D
23. What does the 'ready' state indicate for a process?
o A) The process is currently executing
o B) The process is waiting for I/O
o C) The process is prepared to execute
o D) The process has been terminated
o Answer: C
24. What is the purpose of process scheduling?
o A) To manage memory
o B) To determine which process runs at a given time
o C) To handle input and output
o D) To allocate disk space
o Answer: B
25. Which of the following is a common scheduling algorithm?
o A) Shortest Job First (SJF)
o B) First-Come, First-Served (FCFS)
o C) Round Robin (RR)
o D) All of the above
o Answer: D
CPU Scheduling
26. What is the main goal of CPU scheduling?
o A) To maximize CPU utilization
o B) To minimize response time
o C) To optimize throughput
o D) All of the above
o Answer: D
27. In Round Robin scheduling, each process is given:
o A) A fixed time slice
o B) Unlimited time
o C) The time needed to complete
o D) No time at all
o Answer: A
28. Which scheduling algorithm is most suitable for batch processing?
o A) Round Robin
o B) Shortest Job First (SJF)
o C) Priority Scheduling
o D) Multilevel Queue Scheduling
o Answer: B
29. In a multi-level queue scheduling algorithm:
o A) Processes are permanently assigned to one queue
o B) All processes are treated equally
o C) There is a single queue for all processes
o D) Processes can move between queues
o Answer: A
30. What is priority inversion?
o A) When a low-priority process runs before a high-priority process
o B) When multiple processes have the same priority
o C) When the CPU is idle
o D) None of the above
o Answer: A
Synchronization
31. What is the purpose of process synchronization?
o A) To ensure correct execution of processes accessing shared resources
o B) To increase CPU utilization
o C) To reduce memory usage
o D) To speed up I/O operations
o Answer: A
32. Which of the following is a synchronization primitive?
o A) Mutex
o B) Semaphore
o C) Monitor
o D) All of the above
o Answer: D
Synchronization
34. Which of the following describes a semaphore?
o A) A special type of mutex that allows multiple threads to access a resource
o B) A mechanism that allows processes to communicate with each other
o C) A structure that holds the state of a process
o D) A hardware interrupt mechanism
o Answer: A
35. What is a deadlock?
o A) A state where processes cannot proceed because they are waiting for each other
o B) A situation where a process is terminated
o C) A scenario where the CPU is idle
o D) None of the above
o Answer: A
36. Which of the following conditions is NOT necessary for a deadlock to occur?
o A) Mutual exclusion
o B) Hold and wait
o C) Preemption
o D) Circular wait
o Answer: C
37. How can deadlocks be prevented?
o A) By allowing processes to hold multiple resources
o B) By enforcing strict ordering of resource requests
o C) By using non-blocking algorithms
o D) All of the above
o Answer: B
38. In a producer-consumer problem, which synchronization mechanism is commonly used?
o A) Mutex
o B) Semaphore
o C) Condition Variable
o D) All of the above
o Answer: D
Memory Management
39. What is the main goal of memory management in an operating system?
o A) To increase CPU speed
o B) To allocate memory to processes efficiently
o C) To manage file systems
o D) To schedule CPU tasks
o Answer: B
40. Which of the following describes contiguous memory allocation?
o A) Allocating non-contiguous blocks of memory to processes
o B) Assigning a single continuous block of memory to a process
o C) Using paging to divide memory into frames
o D) Allowing processes to share memory
o Answer: B
41. What is fragmentation in memory management?
o A) The division of memory into smaller sections
o B) Inefficient use of memory due to allocation and deallocation
o C) The process of copying data from one location to another
o D) The organization of processes in memory
o Answer: B
42. Which type of fragmentation occurs when free memory is divided into small blocks?
o A) Internal fragmentation
o B) External fragmentation
o C) Memory pooling
o D) None of the above
o Answer: B
43. What is the purpose of a page replacement algorithm?
o A) To load pages into memory
o B) To decide which pages to remove from memory when new pages need to be
loaded
o C) To allocate memory for processes
o D) To optimize CPU usage
o Answer: B
File Systems
44. What is a file system?
o A) A method for organizing data on a storage device
o B) A way to manage network connections
o C) A structure for handling CPU tasks
o D) A method for executing processes
o Answer: A
45. Which of the following is NOT a file attribute?
o A) Name
o B) Size
o C) Location
o D) Process ID
o Answer: D
46. What is the purpose of a directory in a file system?
o A) To store metadata about files
o B) To group related files and manage file paths
o C) To execute file operations
o D) To manage memory allocation
o Answer: B
47. In which type of file allocation does the file system allocate contiguous blocks of disk
space?
o A) Linked allocation
o B) Indexed allocation
o C) Contiguous allocation
o D) None of the above
o Answer: C
48. Which file system is known for its journaling feature?
o A) FAT32
o B) NTFS
o C) ext3
o D) Both B and C
o Answer: D
I/O Management
49. What is the purpose of I/O management in an operating system?
o A) To allocate CPU resources
o B) To manage data transfer between the CPU and I/O devices
o C) To handle memory allocation
o D) To schedule processes
o Answer: B
50. Which of the following I/O techniques allows a program to continue executing while
waiting for I/O operations to complete?
o A) Blocking I/O
o B) Non-blocking I/O
o C) Polling
o D) Direct I/O
o Answer: B
51. What is a device driver?
o A) A software component that controls a hardware device
o B) A protocol for network communication
o C) A memory allocation technique
o D) A type of operating system
o Answer: A
52. Which of the following is an advantage of Direct Memory Access (DMA)?
o A) It reduces CPU overhead during I/O operations
o B) It allows faster data transfer rates
o C) It simplifies I/O operations
o D) All of the above
o Answer: D
53. What does buffering in I/O operations refer to?
o A) Storing data temporarily to accommodate speed differences between I/O devices
and the CPU
o B) Allocating additional memory for processes
o C) The process of compressing data
o D) Managing process priorities
o Answer: A
Advanced Concepts
54. What is the main function of an operating system kernel?
o A) To manage user interfaces
o B) To interact with hardware and manage system resources
o C) To execute applications
o D) To provide networking capabilities
o Answer: B
55. Which of the following is an example of a microkernel?
o A) Linux
o B) Windows NT
o C) QNX
o D) UNIX
o Answer: C
56. What is a system call?
o A) A request made by a user to access system resources
o B) A request made by a program to the operating system for a service
o C) A method to handle errors in a program
o D) A command executed by the CPU
o Answer: B
57. Which type of operating system allows multiple users to share resources simultaneously?
o A) Real-time OS
o B) Batch OS
o C) Time-sharing OS
o D) Network OS
o Answer: C
58. What is the purpose of a watchdog timer?
o A) To measure system performance
o B) To detect system faults and reset the system if necessary
o C) To manage power consumption
o D) To allocate memory
o Answer: B
General Knowledge
59. Which of the following is NOT a type of operating system?
o A) Batch OS
o B) Time-sharing OS
o C) Resource management OS
o D) Real-time OS
o Answer: C
60. What is the primary role of the command interpreter in an OS?
o A) To execute background processes
o B) To manage user interactions and execute commands
o C) To handle memory allocation
o D) To manage file systems
o Answer: B
Continuing the Question Set
61. Which of the following statements about threads is TRUE?
o A) Threads cannot share resources with other threads
o B) A thread is a lightweight process
o C) Threads have their own memory space
o D) Threads are slower to create than processes
o Answer: B
62. Which scheduling algorithm is designed to minimize turnaround time?
o A) First-Come, First-Served (FCFS)
o B) Shortest Job First (SJF)
o C) Round Robin (RR)
o D) Priority Scheduling
o Answer: B
63. What is context switching?
o A) Switching between user interfaces
o B) Saving and restoring the state of a CPU so that multiple processes can share a
single CPU
o C) Changing the priority of processes
o D) Transferring data between processes
o Answer: B
64. Which of the following is a disadvantage of a virtual memory system?
o A) It increases the size of the address space
o B) It may lead to thrashing
o C) It improves system performance
o D) It allows multiple processes to run simultaneously
o Answer: B
Buffer Cache and Performance
66. What is the main purpose of a buffer cache in an operating system?
o A) To store the executable files of applications
o B) To reduce the number of disk I/O operations by caching frequently accessed data
o C) To manage the CPU registers
o D) To allocate memory for processes
o Answer: B
67. Which scheduling algorithm is based on assigning a fixed time slice to each process?
o A) First-Come, First-Served (FCFS)
o B) Shortest Job First (SJF)
o C) Round Robin (RR)
o D) Priority Scheduling
o Answer: C
68. Which of the following is an effect of thrashing?
o A) Increased CPU utilization
o B) Decreased system performance due to excessive paging
o C) Enhanced multitasking capabilities
o D) Reduced memory usage
o Answer: B
Virtual Memory
69. What does the term 'paging' refer to in the context of virtual memory?
o A) The process of saving a file to disk
o B) Dividing virtual memory into fixed-size blocks called pages
o C) The allocation of contiguous memory blocks to processes
o D) None of the above
o Answer: B
70. In a paging system, what is the purpose of a page table?
o A) To manage physical memory
o B) To map virtual addresses to physical addresses
o C) To store process states
o D) To handle interrupts
o Answer: B
71. What is the effect of a page fault?
o A) The system crashes
o B) The process is terminated
o C) The operating system retrieves the missing page from disk
o D) The CPU is reset
o Answer: C
Security and Protection
72. What is the purpose of access control in an operating system?
o A) To manage system resources
o B) To define who can access certain resources and what actions they can perform
o C) To schedule processes
o D) To optimize memory usage
o Answer: B
73. Which of the following is a common method of protecting system memory?
o A) Segmentation
o B) Data encryption
o C) Compression
o D) Paging
o Answer: A
74. What is the role of user authentication in an operating system?
o A) To manage file access
o B) To verify the identity of users attempting to access the system
o C) To allocate CPU time
o D) To manage memory allocation
o Answer: B
75. Which of the following describes a firewall?
o A) A hardware device that accelerates data processing
o B) A software application that protects the system from unauthorized access
o C) A tool for managing processes
o D) A memory management technique
o Answer: B
Networking and Operating Systems
76. What is the primary function of a network operating system?
o A) To manage local hardware resources
o B) To enable communication between multiple computers and manage network
resources
o C) To run applications in isolation
o D) To manage CPU scheduling
o Answer: B
77. Which protocol is used for sending error messages and operational information on a
network?
o A) TCP
o B) IP
o C) ICMP
o D) FTP
o Answer: C
78. What does the acronym DHCP stand for?
o A) Dynamic Host Configuration Protocol
o B) Data Handling and Control Protocol
o C) Distributed Host Communication Protocol
o D) Dynamic Host Control Protocol
o Answer: A
Advanced Operating Systems
79. Which of the following is a characteristic of a real-time operating system (RTOS)?
o A) It has high throughput but may have variable response time
o B) It guarantees a specific response time for critical tasks
o C) It is designed for batch processing
o D) It runs only on single-user systems
o Answer: B
80. What is the main goal of a distributed operating system?
o A) To run applications on a single machine
o B) To manage resources across multiple interconnected computers
o C) To optimize the performance of a single CPU
o D) To handle memory management for embedded systems
o Answer: B
81. Which of the following describes a hypervisor?
o A) A system that manages hardware resources for a single operating system
o B) A software layer that allows multiple operating systems to run on a single
hardware platform
o C) A tool for managing user interfaces
o D) A protocol for network communication
o Answer: B
Miscellaneous
82. Which of the following is a command used to display the current working directory in a
Unix/Linux environment?
o A) cd
o B) pwd
o C) ls
o D) dir
o Answer: B
83. What is a bootloader?
o A) A program that loads an operating system into memory
o B) A tool for managing user permissions
o C) A hardware component of a computer
o D) A type of file system
o Answer: A
84. What is the purpose of system logs in an operating system?
o A) To record system activities and errors
o B) To optimize memory usage
o C) To schedule tasks
o D) To manage user interfaces
o Answer: A
85. Which type of user interface allows users to interact with the operating system using
graphical elements?
o A) Command-Line Interface (CLI)
o B) Graphical User Interface (GUI)
o C) Application Programming Interface (API)
o D) Batch Processing Interface
o Answer: B
86. In the context of operating systems, what does 'virtualization' refer to?
o A) Running multiple applications simultaneously
o B) Creating a simulated environment for running applications
o C) Using hardware to manage memory
o D) Encrypting data
o Answer: B
87. Which of the following is an example of an embedded operating system?
o A) Windows
o B) Android
o C) iOS
o D) RTOS for a washing machine
o Answer: D
88. What is the primary purpose of an operating system's shell?
o A) To manage hardware resources
o B) To execute commands entered by users
o C) To provide a graphical user interface
o D) To handle file operations
o Answer: B
89. Which of the following can be a consequence of not managing system resources
effectively?
o A) Increased system performance
o B) Resource contention and system crashes
o C) Faster task execution
o D) Enhanced user experience
o Answer: B
PROBLEMS:
Shortest Job First (SJF)
1. In the Shortest Job First (SJF) scheduling algorithm, how is the next process to be executed
determined?
o A) The process with the largest burst time
o B) The process with the shortest burst time
o C) The process that arrives first in the queue
o D) The process with the highest priority
o Answer: B
2. Which of the following is a disadvantage of the Shortest Job First (SJF) scheduling algorithm?
o A) It can lead to starvation for longer processes
o B) It guarantees the shortest turnaround time
o C) It is easy to implement
o D) It requires minimal CPU utilization
o Answer: A
3. Consider the following processes with their burst times:
o Process P1: 6 ms
o Process P2: 8 ms
o Process P3: 7 ms
o Process P4: 3 ms
o What is the average waiting time using the SJF scheduling algorithm?
o A) 5.5 ms
o B) 7 ms
o C) 6 ms
o D) 4.5 ms
o Answer: A
o Calculation:
Order: P4 (3), P1 (6), P3 (7), P2 (8)
Waiting times: P4 = 0, P1 = 3, P3 = 9, P2 = 16
Average waiting time = (0 + 3 + 9 + 16) / 4 = 7 ms
Round Robin (RR)
4. In the Round Robin scheduling algorithm, what happens if a process does not finish within its
time quantum?
o A) It is terminated immediately
o B) It is put back at the end of the ready queue
o C) It runs until it completes
o D) It is paused indefinitely
o Answer: B
5. What is the primary advantage of the Round Robin scheduling algorithm?
o A) It minimizes the average waiting time
o B) It provides a fair allocation of CPU time to all processes
o C) It prevents starvation
o D) It is easy to implement
o Answer: B
6. Consider the following processes with burst times and a time quantum of 4 ms:
o Process P1: 8 ms
o Process P2: 4 ms
o Process P3: 9 ms
o Process P4: 5 ms
o What is the average turnaround time using the Round Robin scheduling algorithm?
o A) 11.75 ms
o B) 12.5 ms
o C) 13 ms
o D) 10 ms
o Answer: A
o Calculation:
Completion times: P1 = 12, P2 = 4, P3 = 20, P4 = 17
Turnaround times: P1 = 12, P2 = 4, P3 = 20, P4 = 17
Average turnaround time = (12 + 4 + 20 + 17) / 4 = 13.25 ms
Deadlock
7. Which of the following conditions is NOT necessary for a deadlock to occur?
o A) Mutual Exclusion
o B) Hold and Wait
o C) Preemption
o D) Circular Wait
o Answer: C
8. In a system with 3 processes and 2 resources, if each process holds 1 resource and is waiting
for 1 more resource, what is the system experiencing?
o A) Starvation
o B) Deadlock
o C) Thrashing
o D) None of the above
o Answer: B
9. What is a deadlock avoidance strategy?
o A) Ignoring the problem and hoping it resolves itself
o B) Allowing deadlocks to happen and recovering from them later
o C) Ensuring that at least one of the necessary conditions for deadlock cannot hold
o D) Terminating processes randomly to free up resources
o Answer: C
10. Which algorithm is used to avoid deadlocks by ensuring that the system is always in a safe
state?
o A) First-Come, First-Served
o B) Banker's Algorithm
o C) Shortest Job First
o D) Round Robin
o Answer: B
11. If there are 5 processes and 3 resources in a system, how many additional resources must be
available to ensure the system is deadlock-free?
o A) 1
o B) 2
o C) 3
o D) 4
o Answer: B
o Explanation: According to the formula for deadlock avoidance, the number of
additional resources required is (number of processes - 1).