Practice Operating Systems MCQs for NUST NET Engineering Test computer science — topic-wise sets with solved answers.
Q1. What is the primary function of the Operating System?
Answer: All of the above
Explanation: The primary function of an OS is to manage hardware resources, provide a platform for application software, and offer a user interface.
Q2. Which scheduling algorithm is prone to starvation?
Answer: Priority Scheduling
Explanation: Priority Scheduling can lead to starvation if a process with low priority is indefinitely delayed by higher-priority processes.
Q3. What is the purpose of a semaphore in Operating System?
Answer: Process synchronization
Explanation: Semaphores are used for process synchronization, controlling access to shared resources by multiple processes.
Q4. Which of the following is a characteristic of a Real-Time Operating System?
Answer: Predictable response time
Explanation: Real-Time Operating Systems are designed to provide predictable response times to events, making them suitable for time-critical applications.
Q5. What is the difference between a thread and a process?
Answer: Threads share the same memory space, while processes do not
Explanation: Threads within a process share the same memory space, whereas processes have their own separate memory spaces.
Q6. Which file system is known for its journaling feature?
Answer: EXT3
Explanation: EXT3 is a journaling file system, which means it logs changes before writing them to disk, ensuring file system consistency.
Q7. What is the purpose of the 'wait()' system call?
Answer: To wait for a child process to terminate
Explanation: The 'wait()' system call is used by a parent process to wait for the termination of its child process.
Q8. Which memory allocation technique is prone to external fragmentation?
Answer: Segmentation
Explanation: Segmentation is prone to external fragmentation because it allocates memory in variable-sized blocks, leading to gaps between allocated segments.
Q9. What is the function of the Memory Management Unit (MMU)?
Answer: To translate virtual addresses to physical addresses
Explanation: The MMU translates virtual addresses used by a program into physical addresses in the computer's memory.
Q10. Which of the following is a benefit of using threads?
Answer: Faster context switching
Explanation: Threads have faster context switching compared to processes because they share the same memory space and resources.
Q11. What is a deadlock in Operating System?
Answer: A situation where a process is waiting for a resource held by another process
Explanation: A deadlock occurs when two or more processes are blocked, each waiting for a resource held by the other.
Q12. Which algorithm is used for disk scheduling?
Answer: All of the above
Explanation: FCFS, SSTF, and SCAN are all disk scheduling algorithms used to optimize disk access times.
Q13. What is the purpose of the 'fork()' system call?
Answer: To create a new process
Explanation: The 'fork()' system call is used to create a new process by duplicating the calling process.
Q14. Which of the following is a characteristic of a microkernel?
Answer: It runs OS services in user space
Explanation: A microkernel runs OS services in user space, making it more modular and potentially more secure.
Q15. What is the Banker's algorithm used for?
Answer: Deadlock avoidance
Explanation: The Banker's algorithm is used for deadlock avoidance by ensuring that resource allocation does not lead to a deadlock state.
Q16. Which of the following is true about a kernel?
Answer: It manages hardware resources
Explanation: The kernel is the core part of the OS that manages hardware resources and provides services to applications.
Q17. What is a critical section in Operating System?
Answer: A section of code that accesses shared resources
Explanation: A critical section is a part of the code that accesses shared resources and must be executed atomically to prevent data inconsistency.
Q18. Which synchronization mechanism is used to avoid busy waiting?
Answer: All of the above
Explanation: Semaphores, monitors, and mutexes are all synchronization mechanisms that can be used to avoid busy waiting by putting a process to sleep until a resource is available.
Q19. What is the purpose of paging in memory management?
Answer: To reduce external fragmentation
Explanation: Paging reduces external fragmentation by dividing memory into fixed-size blocks called pages, making memory allocation more efficient.
Q20. Which of the following is a type of Operating System?
Answer: All of the above
Explanation: Batch, Time-Sharing, and Distributed Operating Systems are all types of Operating Systems, each designed for specific use cases.
Loading...