Operating System – MCQ Practice Pack - Khurram Softwares -->

Advertisement

Operating System – MCQ Practice Pack

OS MCQ Practice Pack – KPPSC

Operating System – MCQ Practice Pack

CPU Scheduling | Deadlock | Memory Management | Process Management | File Systems

Prepared for KPPSC Commission Test Preparation


Total Questions Topics Covered Difficulty Best For
100 MCQs 10 Sections Intermediate–High KPPSC / ETEA / FPPSC
Section: CPU Scheduling – Basics
Q1. Which scheduling algorithm gives the minimum average waiting time for a given set of processes?
A) FCFS
B) Round Robin
C) SJF (non-preemptive)
D) Priority Scheduling
✓ Correct Answer: C
Q2. FCFS scheduling is also known as:
A) Shortest Job First
B) First-In First-Out (FIFO)
C) Round Robin
D) Multilevel Queue
✓ Correct Answer: B
Q3. Which of the following is a preemptive version of SJF?
A) Priority Scheduling
B) FCFS
C) SRTF (Shortest Remaining Time First)
D) HRRN
✓ Correct Answer: C
Q4. Round Robin scheduling is best suited for:
A) Batch processing systems
B) Real-time systems
C) Time-sharing systems
D) Single-user systems
✓ Correct Answer: C
Q5. The time quantum in Round Robin scheduling directly affects:
A) Throughput only
B) Context switching overhead and response time
C) Memory usage
D) I/O wait time
✓ Correct Answer: B
Q6. Convoy effect is a drawback of which scheduling algorithm?
A) SJF
B) Round Robin
C) FCFS
D) SRTF
✓ Correct Answer: C
Q7. Which scheduling criterion measures the fraction of time the CPU is busy?
A) Throughput
B) CPU Utilization
C) Response Time
D) Turnaround Time
✓ Correct Answer: B
Q8. Turnaround time is defined as:
A) Time from submission to completion of a process
B) Time a process waits in the ready queue
C) Time taken by the CPU to execute a process
D) Time for the first response
✓ Correct Answer: A
Q9. Which algorithm may cause starvation?
A) Round Robin
B) FCFS
C) Priority Scheduling
D) Both A and C
✓ Correct Answer: C
Q10. Aging is a technique used to prevent:
A) Deadlock
B) Starvation
C) Thrashing
D) Fragmentation
✓ Correct Answer: B
Section: CPU Scheduling – Advanced
Q11. In Multilevel Queue Scheduling, which queue typically has the highest priority?
A) Batch processes
B) System processes
C) Interactive processes
D) Background processes
✓ Correct Answer: B
Q12. Which scheduling algorithm has the best response time for interactive processes?
A) FCFS
B) SJF
C) Round Robin
D) HRRN
✓ Correct Answer: C
Q13. The Highest Response Ratio Next (HRRN) algorithm calculates priority as:
A) Burst time / Waiting time
B) (Waiting time + Burst time) / Burst time
C) Burst time - Waiting time
D) Waiting time × Burst time
✓ Correct Answer: B
Q14. Which scheduling is used in real-time operating systems?
A) FCFS
B) Round Robin
C) Rate Monotonic Scheduling
D) Multilevel Feedback Queue
✓ Correct Answer: C
Q15. Multilevel Feedback Queue differs from Multilevel Queue in that:
A) Processes cannot move between queues
B) Processes can move between queues based on behavior
C) It uses only one queue
D) It doesn't use time quantum
✓ Correct Answer: B
Q16. Context switching overhead increases when:
A) Time quantum is large
B) Time quantum is small
C) Number of processes is small
D) CPU speed is high
✓ Correct Answer: B
Q17. Which scheduling algorithm is non-preemptive by nature?
A) SRTF
B) Round Robin
C) FCFS
D) Both A and B
✓ Correct Answer: C
Q18. In priority scheduling, a lower priority number means:
A) Lower priority
B) Higher priority
C) Equal priority
D) No priority
✓ Correct Answer: B
Q19. The scheduling algorithm that gives minimum average waiting time for uniform arrival time:
A) FCFS
B) Round Robin
C) SJF
D) Priority
✓ Correct Answer: C
Q20. Which of the following is NOT a scheduling criterion?
A) CPU Utilization
B) Throughput
C) Memory Size
D) Response Time
✓ Correct Answer: C
Section: Process Synchronization
Q21. The critical section problem requires which three conditions?
A) Mutual exclusion, Progress, Bounded waiting
B) Deadlock, Starvation, Mutual exclusion
C) Semaphore, Monitor, Mutex
D) Locking, Blocking, Waiting
✓ Correct Answer: A
Q22. A semaphore is a variable used for:
A) Memory management
B) Process synchronization
C) CPU scheduling
D) File management
✓ Correct Answer: B
Q23. A binary semaphore can take values:
A) 0 to n
B) 0 and 1 only
C) -1 and 1
D) Any integer
✓ Correct Answer: B
Q24. The wait() operation on a semaphore is also called:
A) signal()
B) V operation
C) P operation
D) post()
✓ Correct Answer: C
Q25. Which of the following is a classical synchronization problem?
A) Travelling Salesman Problem
B) Producer-Consumer Problem
C) Shortest Path Problem
D) Knapsack Problem
✓ Correct Answer: B
Q26. A monitor is a high-level synchronization construct that provides:
A) Manual locking
B) Automatic mutual exclusion
C) Busy waiting
D) Spinlocks
✓ Correct Answer: B
Q27. Busy waiting in synchronization is also called:
A) Blocking
B) Spin-lock
C) Deadlock
D) Starvation
✓ Correct Answer: B
Q28. The Dining Philosophers Problem was proposed by:
A) Alan Turing
B) Edsger Dijkstra
C) Donald Knuth
D) Ken Thompson
✓ Correct Answer: B
Q29. Peterson's solution works for how many processes?
A) Any number
B) Three only
C) Two only
D) Four only
✓ Correct Answer: C
Q30. Which of the following provides mutual exclusion without busy waiting?
A) Spinlock
B) Semaphore with sleep/wakeup
C) Simple flag variable
D) Interrupt disabling
✓ Correct Answer: B
Section: Deadlock – Concepts
Q31. Deadlock occurs when a process is waiting for a resource that is:
A) Available
B) Held by another waiting process
C) In the ready queue
D) Allocated to the CPU
✓ Correct Answer: B
Q32. Which of the following is NOT a necessary condition for deadlock?
A) Mutual Exclusion
B) Hold and Wait
C) Preemption
D) Circular Wait
✓ Correct Answer: C
Q33. Circular wait means:
A) Processes run in a loop
B) Each process waits for a resource held by the next process in the chain
C) All processes wait for I/O
D) The CPU waits for memory
✓ Correct Answer: B
Q34. The 'No Preemption' condition for deadlock means:
A) Resources can be forcibly taken
B) Resources cannot be forcibly taken from a process
C) Processes cannot be preempted
D) CPU scheduling is non-preemptive
✓ Correct Answer: B
Q35. Resource Allocation Graph (RAG) is used to:
A) Schedule CPU processes
B) Detect deadlock in single-instance resources
C) Manage memory pages
D) Allocate I/O devices
✓ Correct Answer: B
Q36. In a RAG, a cycle indicates:
A) Always a deadlock
B) Deadlock only if single-instance resources
C) No deadlock
D) Starvation
✓ Correct Answer: B
Q37. Which of the following is a deadlock avoidance algorithm?
A) Banker's Algorithm
B) Dijkstra's Algorithm
C) Round Robin
D) Page Replacement
✓ Correct Answer: A
Q38. The Banker's Algorithm was proposed by:
A) Donald Knuth
B) Edsger Dijkstra
C) Andrew Tanenbaum
D) Ken Thompson
✓ Correct Answer: B
Q39. A safe state in Banker's Algorithm means:
A) No process is running
B) There exists a safe sequence to complete all processes
C) All resources are allocated
D) All processes are in waiting state
✓ Correct Answer: B
Q40. Deadlock prevention involves:
A) Detecting deadlock after it occurs
B) Eliminating one or more necessary conditions for deadlock
C) Recovering from deadlock
D) Allowing deadlock temporarily
✓ Correct Answer: B
Section: Deadlock – Detection & Recovery
Q41. Deadlock detection algorithms are used when:
A) Prevention is too costly
B) Avoidance is applied
C) Resources are unlimited
D) No processes run
✓ Correct Answer: A
Q42. Which data structure is used in deadlock detection for multiple-instance resources?
A) Stack
B) Queue
C) Wait-for Graph
D) Allocation Matrix
✓ Correct Answer: C
Q43. The wait-for graph is derived from the Resource Allocation Graph by:
A) Adding resource nodes
B) Removing resource nodes
C) Adding process nodes
D) Reversing all edges
✓ Correct Answer: B
Q44. In deadlock recovery, process termination means:
A) Suspending all processes
B) Aborting one or more deadlocked processes
C) Restarting the OS
D) Removing resource nodes
✓ Correct Answer: B
Q45. Resource preemption as deadlock recovery means:
A) Allocating more resources
B) Forcibly taking resources from a process
C) Killing all processes
D) Adding new resources
✓ Correct Answer: B
Q46. Which approach accepts that deadlock may occur and recovers from it?
A) Deadlock Prevention
B) Deadlock Avoidance
C) Deadlock Detection and Recovery
D) Deadlock Ignorance
✓ Correct Answer: C
Q47. The Ostrich Algorithm refers to:
A) Deadlock Prevention
B) Ignoring the deadlock problem
C) Deadlock Detection
D) Resource Preemption
✓ Correct Answer: B
Q48. To break circular wait condition, we can:
A) Assign each resource a unique number and require ordered acquisition
B) Allow multiple resources simultaneously
C) Use semaphores
D) Increase memory
✓ Correct Answer: A
Q49. To break 'Hold and Wait', a process must:
A) Request all resources at once before starting
B) Hold resources while waiting
C) Release only unused resources
D) Wait indefinitely
✓ Correct Answer: A
Q50. Livelock is different from deadlock because in livelock:
A) Processes are blocked
B) Processes keep changing state without making progress
C) Resources are unavailable
D) CPU is idle
✓ Correct Answer: B
Section: Memory Management
Q51. Internal fragmentation occurs in:
A) Segmentation
B) Fixed-size partitioning
C) Paging with variable pages
D) Dynamic partitioning
✓ Correct Answer: B
Q52. External fragmentation occurs in:
A) Fixed-size partitioning
B) Paging
C) Dynamic partitioning
D) Both A and B
✓ Correct Answer: C
Q53. Compaction is a technique to solve:
A) Internal fragmentation
B) External fragmentation
C) Page faults
D) Thrashing
✓ Correct Answer: B
Q54. A page table is used in:
A) Segmentation
B) Contiguous allocation
C) Paging
D) Swapping
✓ Correct Answer: C
Q55. Translation Lookaside Buffer (TLB) is a:
A) Type of RAM
B) Fast cache for page table entries
C) Secondary storage
D) I/O buffer
✓ Correct Answer: B
Q56. Virtual memory allows processes to use:
A) Only physical memory
B) More memory than physically available
C) Only cache memory
D) Shared memory only
✓ Correct Answer: B
Q57. Thrashing occurs when:
A) CPU is idle
B) Too many processes cause excessive paging
C) Memory is too large
D) CPU speed is too slow
✓ Correct Answer: B
Q58. The optimal page replacement algorithm replaces the page:
A) Used least recently
B) That will not be used for the longest time
C) That arrived first
D) Used most recently
✓ Correct Answer: B
Q59. LRU page replacement stands for:
A) Least Recently Used
B) Last Replaced Unit
C) Least Required Unit
D) Lowest Resource Utilization
✓ Correct Answer: A
Q60. Belady's Anomaly is associated with which page replacement algorithm?
A) LRU
B) Optimal
C) FIFO
D) Clock
✓ Correct Answer: C
Section: Process Management
Q61. A process is:
A) A program stored on disk
B) A program in execution
C) A set of instructions
D) An operating system component
✓ Correct Answer: B
Q62. The Process Control Block (PCB) contains:
A) Only the program code
B) Process state, registers, memory info, and scheduling info
C) Only memory addresses
D) Only I/O device status
✓ Correct Answer: B
Q63. Which process state comes after 'Ready'?
A) New
B) Waiting
C) Running
D) Terminated
✓ Correct Answer: C
Q64. Inter-Process Communication (IPC) methods include:
A) Shared memory and message passing
B) Only file systems
C) Only semaphores
D) Only signals
✓ Correct Answer: A
Q65. A thread is also called a:
A) Heavy-weight process
B) Light-weight process
C) Sub-process
D) Child process
✓ Correct Answer: B
Q66. Threads within the same process share:
A) Program counter and stack
B) Code, data, and OS resources
C) Registers only
D) All of the above
✓ Correct Answer: B
Q67. Zombie process is a process that has:
A) Not started yet
B) Finished execution but entry in process table remains
C) Been blocked for too long
D) No parent process
✓ Correct Answer: B
Q68. An orphan process is a process whose:
A) Child has died
B) Parent has terminated
C) Resources are deallocated
D) PCB is empty
✓ Correct Answer: B
Q69. Fork() system call creates:
A) A new thread
B) A copy of the calling process
C) A new file
D) A new device driver
✓ Correct Answer: B
Q70. Which of the following is NOT a process state?
A) Ready
B) Running
C) Compiling
D) Waiting
✓ Correct Answer: C
Section: OS Concepts – General
Q71. Multiprogramming refers to:
A) Running multiple CPUs simultaneously
B) Keeping multiple programs in memory to maximize CPU use
C) Using multiple monitors
D) Multi-user operating systems
✓ Correct Answer: B
Q72. Time-sharing OS allows:
A) Only one user at a time
B) Multiple users to use CPU concurrently via rapid switching
C) Unlimited memory
D) Real-time process scheduling only
✓ Correct Answer: B
Q73. A kernel is:
A) The user interface of OS
B) The core of an operating system managing resources
C) A type of process
D) An application software
✓ Correct Answer: B
Q74. System calls provide an interface between:
A) Hardware and software
B) User programs and OS kernel
C) Memory and CPU
D) Processes and files
✓ Correct Answer: B
Q75. Which of the following is NOT a type of operating system?
A) Batch OS
B) Real-time OS
C) Distributed OS
D) Compiler OS
✓ Correct Answer: D
Q76. Spooling stands for:
A) Simultaneous Peripheral Operations On-Line
B) Single Process Output Operation Line
C) Shared Peripheral Output Operation Loop
D) System Process Output On-Line
✓ Correct Answer: A
Q77. Which of the following is an example of non-preemptive scheduling?
A) Round Robin
B) SRTF
C) FCFS
D) Rate Monotonic
✓ Correct Answer: C
Q78. The main purpose of an OS is to:
A) Compile programs
B) Manage hardware and provide services to user programs
C) Design hardware
D) Connect to the internet
✓ Correct Answer: B
Q79. A real-time OS guarantees:
A) Maximum throughput
B) Response within a specified time deadline
C) Minimum memory usage
D) Unlimited processing
✓ Correct Answer: B
Q80. DMA stands for:
A) Direct Memory Access
B) Dynamic Memory Allocation
C) Disk Memory Address
D) Data Management Architecture
✓ Correct Answer: A
Section: File Systems & I/O
Q81. Seek time in a hard disk is the time to:
A) Read data from the disk
B) Move the read/write head to the correct track
C) Transfer data to memory
D) Rotate the disk to the correct sector
✓ Correct Answer: B
Q82. SSTF disk scheduling stands for:
A) Shortest Seek Time First
B) Slowest Sector Transfer First
C) Simple Scan Transfer First
D) Shortest Sector Time First
✓ Correct Answer: A
Q83. The SCAN disk scheduling algorithm is also called:
A) Elevator Algorithm
B) Circular Scan
C) FCFS
D) Round Robin
✓ Correct Answer: A
Q84. Which file allocation method suffers from external fragmentation?
A) Indexed allocation
B) Linked allocation
C) Contiguous allocation
D) Both A and B
✓ Correct Answer: C
Q85. Inode in Unix stores:
A) File name only
B) File metadata and pointers to data blocks
C) Directory structure
D) File content
✓ Correct Answer: B
Q86. A directory is essentially a:
A) List of file names and their inode numbers
B) Storage for file data
C) System call
D) Memory block
✓ Correct Answer: A
Q87. Buffering in I/O is used to:
A) Increase CPU speed
B) Smooth out speed differences between devices and CPU
C) Increase memory
D) Reduce context switching
✓ Correct Answer: B
Q88. Which of the following is NOT a disk scheduling algorithm?
A) FCFS
B) SSTF
C) SCAN
D) SJF
✓ Correct Answer: D
Q89. FAT stands for:
A) File Allocation Table
B) Fast Access Technology
C) Fixed Address Tree
D) File Archive Type
✓ Correct Answer: A
Q90. The purpose of a file system is to:
A) Execute programs
B) Organize and manage storage on disk
C) Manage CPU scheduling
D) Control network communication
✓ Correct Answer: B
Section: Bonus – Mixed High-Yield Topics
Q91. Which of the following algorithms avoids deadlock by denying resource requests that could lead to an unsafe state?
A) Deadlock Detection
B) Banker's Algorithm
C) Ostrich Algorithm
D) FCFS
✓ Correct Answer: B
Q92. Which page replacement algorithm suffers from Belady's Anomaly?
A) FIFO
B) LRU
C) Optimal
D) Clock
✓ Correct Answer: A
Q93. Which of the following is true about a monitor?
A) Multiple processes can be inside a monitor at the same time
B) Only one process can be active inside a monitor at a time
C) Monitors do not support condition variables
D) Monitors are implemented using hardware
✓ Correct Answer: B
Q94. In the context of scheduling, 'throughput' means:
A) Time for a process to complete
B) Number of processes completed per unit time
C) CPU idle time
D) Memory used per process
✓ Correct Answer: B
Q95. Which condition must be violated to prevent deadlock using resource ordering?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
✓ Correct Answer: D
Q96. The working set model is related to:
A) CPU scheduling
B) Deadlock avoidance
C) Thrashing prevention
D) Disk scheduling
✓ Correct Answer: C
Q97. Which of the following is used to detect deadlock in a system with single-instance resources?
A) Allocation Matrix
B) Wait-for Graph
C) Page Table
D) Semaphore
✓ Correct Answer: B
Q98. Which scheduling policy is most appropriate for minimizing response time in interactive systems?
A) FCFS
B) SJF
C) Round Robin with a small quantum
D) Priority Scheduling
✓ Correct Answer: C
Q99. Which of the following is a necessary condition for a system to be in a safe state?
A) All resources must be free
B) A safe sequence exists for all processes
C) No process is waiting
D) All processes must be running
✓ Correct Answer: B
Q100. In paging, the logical address is divided into:
A) Segment number and offset
B) Page number and page offset
C) Frame number and page number
D) Block number and sector offset
✓ Correct Answer: B