Operating Systems MCQs set 2 for HEC USAT-CS (Computer Science) computer science — 20 solved questions.
Q1. What is the primary function of the operating system's process scheduler?
Answer: CPU Allocation
Explanation: The process scheduler allocates the CPU to processes, determining which process runs next, using algorithms like FCFS or SJF.
Q2. What is a necessary condition for a deadlock to occur?
Answer: All of the above
Explanation: Deadlock occurs when Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait conditions are met simultaneously.
Q3. Which operating system concept is used to prevent starvation?
Answer: Aging
Explanation: Aging increases the priority of a process as it waits, preventing starvation by ensuring it eventually gets CPU time.
Q4. What is the role of a semaphore in operating systems?
Answer: Process Synchronization
Explanation: Semaphores are used for process synchronization, controlling access to shared resources by multiple processes.
Q5. In which scheduling algorithm does the CPU time get divided into fixed time slices?
Answer: Round Robin
Explanation: Round Robin scheduling divides CPU time into fixed time slices (time quanta), allocating each process a turn.
Q6. What is the main advantage of using threads over processes?
Answer: A and C
Explanation: Threads offer faster context switching and better resource utilization compared to processes, as they share the same memory space.
Q7. Which operating system structure is known for its modular design?
Answer: Microkernel
Explanation: Microkernel architecture is modular, separating the kernel into smaller components for better maintainability and security.
Q8. Which technique is used to handle the problem of thrashing?
Answer: Working Set Model
Explanation: The Working Set Model helps prevent thrashing by ensuring a process has its required pages in memory before executing.
Q9. What is the purpose of a system call in an operating system?
Answer: To invoke kernel services
Explanation: System calls provide a way for user-level programs to request services from the kernel, such as process creation or file access.
Q10. In a multitasking operating system, what is context switching?
Answer: Switching the CPU between different processes
Explanation: Context switching involves saving the state of the current process and restoring the state of the next process to be executed.
Q11. What is the main function of a device driver in an operating system?
Answer: To act as an interface between the OS and hardware
Explanation: Device drivers serve as intermediaries between the operating system and hardware devices, facilitating communication and data transfer.
Q12. What is a monitor in the context of operating systems?
Answer: A synchronization construct
Explanation: A monitor is a synchronization construct that allows only one process to access a shared resource at a time, preventing race conditions.
Q13. What is the benefit of using a kernel with a microkernel architecture?
Answer: Modularity and Flexibility
Explanation: Microkernel architecture enhances modularity and flexibility by separating the kernel into smaller, independent components.
Q14. In operating systems, what does ' spooling' refer to?
Answer: Simultaneous Peripheral Operations On-line
Explanation: Spooling is a technique where data is temporarily stored to be processed later, enabling simultaneous peripheral operations.
Q15. What is the primary purpose of a file system's inode?
Answer: To manage file metadata
Explanation: Inodes store metadata about files, such as ownership, permissions, and location on disk, facilitating file system management.
Q16. Which algorithm is used for CPU scheduling in a uniprocessor system?
Answer: All of the above
Explanation: Various algorithms like Round Robin, Priority Scheduling, and Shortest Job First are used for CPU scheduling.
Q17. What is the purpose of a 'semaphore' in Operating Systems?
Answer: Synchronize access to shared resources
Explanation: Semaphore is a variable that controls access to shared resources, preventing simultaneous access.
Q18. Which data structure is used to manage the 'ready queue'?
Answer: Queue
Explanation: A queue is used to manage the 'ready queue', where processes wait for CPU allocation.
Q19. What is the function of a 'dispatcher'?
Answer: All of the above
Explanation: Dispatcher saves the context of the previous process, restores the context of the next process, and gives control of the CPU.
Q20. What is 'paging' in memory management?
Answer: Divide memory into fixed-size blocks
Explanation: Paging involves dividing memory into fixed-size blocks called 'pages' and 'frames'. NET computer science MCQs often test this core concept.