CPU Scheduling Multiple Choice Questions (MCQ) is a comprehensive set of questions designed to test your knowledge and understanding of one of the fundamental concepts in operating systems – CPU scheduling. CPU scheduling plays a crucial role in managing and optimizing the utilization of the central processing unit (CPU) in a computer system, making it a vital topic for computer science and information technology students, as well as professionals in the field.
This MCQ collection is suitable for various educational purposes, including self-assessment, exam preparation, and reinforcing your grasp of CPU scheduling algorithms and related concepts. It covers a wide range of topics related to CPU scheduling.
Each question in this MCQ collection is carefully crafted to challenge your knowledge and analytical skills, allowing you to assess your proficiency in CPU scheduling concepts. You can use this resource to prepare for exams, job interviews, or simply to deepen your understanding of CPU scheduling in operating systems.
Whether you are a student looking to enhance your academic performance or a professional seeking to improve your skills in the field of computer science and IT, these CPU Scheduling MCQs offer an invaluable opportunity to test and broaden your knowledge. Additionally, educators can utilize these questions as a valuable tool for assessing their students’ comprehension of CPU scheduling and related topics.
1. In priority scheduling algorithm ____________
a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) Equal priority processes can not be scheduled
d) None of the mentioned
Answer: CPU is allocated to the process with highest priority
2. Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:
(A) 13 units
(B) 14 units
(C) 15 units
(D) 16 units
Explanation: Let the processes be p0, p1 and p2. These processes will be executed in following order.
p2 p1 p2 p1 p2 p0 p1 p2 p0 p1 p2 0 4 5 6 7 8 9 10 11 12 13 14
Turn around time of a process is total time between submission of the process and its completion.
Turn around time of p0 = 12 (12-0)
Turn around time of p1 = 13 (13-0)
Turn around time of p2 = 14 (14-0)
Average turn around time is (12+13+14)/3 = 13.
3. Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing computation, and the last 10% of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O operations can be overlapped as much as possible. For what percentage of time does the CPU remain idle?
Explanation: Let three processes be p0, p1 and p2. Their execution time is 10, 20 and 30 respectively. p0 spends first 2 time units in I/O, 7 units of CPU time and finally 1 unit in I/O. p1 spends first 4 units in I/O, 14 units of CPU time and finally 2 units in I/O. p2 spends first 6 units in I/O, 21 units of CPU time and finally 3 units in I/O.
idle p0 p1 p2 idle 0 2 9 23 44 47
Total time spent = 47
Idle time = 2 + 3 = 5
Percentage of idle time = (5/47)*100 = 10.6 %
4. Process are classified into different groups in ____________
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm
P1 : 10 : 3 ,
P2 : 1 : 1 ,
P3 : 2 : 4 ,
P4 : 1 : 5 ,
P5 : 5 : 2.
a. 8 milliseconds
b. 8.2 milliseconds
c. 7.75 milliseconds
d. 3 milliseconds
Answer: (b).8.2 milliseconds
6. Which module gives control of the CPU to the process selected by the short-term scheduler?
d. none of the mentioned
7. A major problem with priority scheduling is _________.
a. Definite blocking
c. Low priority
d. None of the above
8. The host repeatedly checks if the controller is busy until it is not. It is in a loop that status register’s busy bit becomes clear. This is called _____________ and a mechanism for the hardware controller to notify the CPU that it is ready is called ___________.
a. Interrupt and Polling
b. Polling and Spooling
c. Polling and Interrupt
d. Deadlock and Starvation
9. Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
Explanation: Let three process be P0, P1 and P2 with arrival times 0, 2 and 6 respectively and CPU burst times 10, 20 and 30 respectively. At time 0, P0 is the only available process so it runs. At time 2, P1 arrives, but P0 has the shortest remaining time, so it continues. At time 6, P2 arrives, but P0 has the shortest remaining time, so it continues. At time 10, P1 is scheduled as it is the shortest remaining time process. At time 30, P2 is scheduled. Only two context switches are needed. P0 to P1 and P1 to P2.
a. Terminating the process
c. Mutual Exclusion
a. Using very large time slice degenerates in to first come first served algorithm
b. Using extremely small time slices improve performance
c. Using extremely small time slices degenerate in to last in first out algorithm
d. Using medium sized time slices leads to shortest request time first algorithm
12. The processes that are residing in main memory and are ready and waiting to execute are kept on a list called:
a. job queue
b. ready queue
c. execution queue
d. process queue
13. The interval from the time of submission of a process to the time of completion is termed as:
a. waiting time
b. turnaround time
c. response time
14. Which scheduling algorithm allocates the CPU first to the process that requests the CPU first?
a. first-come, first-served scheduling
b. shortest job scheduling
c. priority scheduling
d. none of the mentioned
15. In priority scheduling algorithm:
a. CPU is allocated to the process with highest priority
b. CPU is allocated to the process with lowest priority
c. equal priority processes can not be scheduled
d. none of the mentioned
16. Which of the following is a criterion to evaluate a scheduling algorithm?
a. CPU Utilization: Keep CPU utilization as high as possible
b. Throughput: number of processes completed per unit time
c. Waiting Time: Amount of time spent ready to run but not running
d. All of the above