🎓 BookMCQ
← Back to 3. Processes in Operating System

📝 Process Scheduling in operating system (35 MCQs)

CPU Scheduling and Multiprogramming Requirements

Process scheduling is a process-management function that determines which ready process receives CPU execution. When several processes compete for processor time, the operating system uses scheduling policies to select an appropriate candidate from the ready queue. Short-term scheduling controls immediate CPU allocation, while medium-term and long-term scheduling manage process suspension and admission where those facilities are implemented.

Why Ready Processes Need an Allocation Policy

In multiprogramming systems, multiple processes may be ready simultaneously, but an individual CPU core can execute only one thread at a time. A scheduling policy determines how this limited capacity is distributed. Different workloads prioritise response time, throughput, fairness, or deadline satisfaction, so no single algorithm provides optimal results for every application.

Ready Queues, Dispatching, and Preemptive Scheduling

The scheduler selects a process from the ready queue according to its scheduling algorithm. The dispatcher performs the context switch and transfers CPU control to the selected process. In preemptive scheduling, a timer interrupt or higher-priority event can interrupt the running process. Non-preemptive scheduling allows it to retain the CPU until termination or a blocking operation.

Round Robin Scheduling with a 4-Millisecond Quantum

Consider three processes arriving at time zero with CPU bursts P1 = 6 ms, P2 = 4 ms, and P3 = 2 ms. Under Round Robin with a 4 ms quantum, execution follows P1 from 0–4, P2 from 4–8, P3 from 8–10, and P1 from 10–12. All processes complete after their remaining bursts execute.

Waiting Time, Response Time, and Throughput Trade-offs

Scheduling directly influences CPU utilisation, throughput, turnaround time, waiting time, and response time. Round Robin improves responsiveness for interactive workloads, while shortest-job policies can reduce average waiting under suitable assumptions. However, very small time quanta increase context-switch overhead, and priority scheduling may cause starvation without appropriate controls. Multicore systems also require processor-affinity and load-balancing considerations.

Misconceptions About Preemption and Scheduling Algorithms

'Round Robin always selects the shortest process' is incorrect because it rotates through the ready queue. 'SJF guarantees the shortest average waiting time in every practical workload' is incorrect because its optimality assumes suitable known CPU burst information. 'A smaller quantum always improves performance' is incorrect because excessive context switching wastes CPU time.

Exam Focus: Gantt Charts and Scheduling Calculations

Construct Gantt charts for FCFS, SJF, Priority, and Round Robin scheduling using the given arrival times, burst times, and priorities. Calculate completion time, turnaround time, waiting time, and response time using their standard formulas. Pay attention to arrival order, preemption points, priority conventions, and the specified rule for resolving simultaneous scheduling events.

Key Terms of Process Scheduling

  • Ready queue - Collection of processes awaiting CPU allocation.
  • Quantum - Maximum Round Robin time slice.
  • Dispatcher - Transfers CPU control to a process.
  • Preemption - Interrupting a process before completion.
  • Turnaround time - Completion time minus arrival time.
  • Starvation - Indefinite postponement of process execution.
5
Easy
14
Medium
16
Hard

📝 All Process Scheduling in operating system MCQs

Q1. Which scheduling algorithm selects the ready process with the shortest next CPU burst?

A.First come first served
B.Shortest job first ✅
C.Round robin
D.Multilevel queue
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Shortest job first chooses the process whose next CPU burst is expected to be smallest. Running short bursts first reduces the average waiting time of the processes, which is why the algorithm is theoretically optimal for that metric, though it requires knowing or predicting burst lengths.

Q2. Which queue holds processes that are in memory and ready to execute, waiting for the CPU?

A.Ready queue ✅
B.Device queue
C.Job queue
D.Print spool queue
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The ready queue contains processes that have all the resources they need except the CPU. The scheduler selects the next process from this queue whenever the CPU becomes free. Device queues hold processes waiting for specific devices, so they serve a different purpose.

Q3. Which scheduling algorithm assigns each ready process a fixed time slice and cycles through the processes in order?

A.First come first served
B.Shortest job first
C.Round robin ✅
D.Priority scheduling
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Round robin gives each process a fixed quantum in turn, and a process that does not finish is placed at the back of the ready queue. This fairness and responsiveness make it popular for time-sharing systems, although the choice of quantum strongly influences its behaviour.

Q4. Which performance measure is defined as the time from the moment a process is submitted to the moment it completes?

A.Waiting time
B.Turnaround time ✅
C.CPU burst time
D.Response time
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Turnaround time includes all the time a process spends in the system, including waiting in queues, executing on the CPU and performing input or output. Waiting time counts only the time spent in the ready queue, so the two measures differ by the total execution time of the process.

Q5. Which problem occurs when a low-priority process is continually passed over and never receives the CPU?

A.Deadlock
B.Starvation ✅
C.Thrashing
D.Aliasing
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Starvation happens when a process waits indefinitely because higher-priority or shorter work keeps being selected first. It is distinct from deadlock, where processes hold resources and wait on each other, and from thrashing, which involves excessive paging rather than scheduling choices.

Q6. Why does round robin with a very large time quantum behave almost like first come first served?

A.Because a process rarely reaches the end of its quantum before finishing, so preemption almost never occurs. ✅
B.Because the quantum is measured in disk sectors.
C.Because round robin ignores all ready processes.
D.Because large quanta remove the need for a ready queue.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When the quantum exceeds the typical CPU burst, each process runs to completion before the time slice expires. Preemption then almost never happens, so the scheduling order follows arrival order just as in first come first served. This shows how a single parameter moves the algorithm toward a different behaviour.

Q7. Why is it impossible to implement shortest job first exactly in a general-purpose system?

A.Because the scheduler cannot count processes.
B.Because the lengths of future CPU bursts are not known in advance, so the algorithm must rely on estimates. ✅
C.Because the CPU cannot execute short processes.
D.Because shortest job first requires a printer.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The scheduler needs to know how long each process will run before it runs, but CPU bursts depend on program behaviour that is unknown in advance. Practical systems therefore estimate the next burst from past behaviour, making the algorithm an approximation rather than an exact implementation.

Q8. Why is the time spent performing a context switch considered overhead?

A.Because the CPU performs no useful application work while saving and restoring process state. ✅
B.Because context switches always destroy the process.
C.Because context switches are performed by the printer.
D.Because context switches only happen at night.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: During a context switch the processor saves one process's state and loads another's, and no application instructions run in that interval. The time is therefore lost to useful computation, which is why frequent switching reduces throughput even though it may improve responsiveness.

Q9. A student claims that preemptive scheduling always gives higher CPU utilization than non-preemptive scheduling. Which correction is most accurate?

A.The claim is correct because preemption always keeps the CPU busy.
B.Preemption does not guarantee higher utilization, because the extra context switches it causes add overhead that can reduce useful work. ✅
C.Non-preemptive scheduling cannot use the CPU at all.
D.Utilization is determined only by the printer.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Preemption can improve responsiveness, but each interruption costs a context switch. Whether utilization rises or falls depends on the workload and the switching cost, so the student's universal claim ignores the overhead side of the trade-off.

Q10. Why does aging help prevent starvation in a priority scheduling system?

A.It gradually increases the priority of processes that have waited a long time, so they eventually receive the CPU. ✅
B.It deletes low-priority processes to free memory.
C.It makes all processes equal in priority at all times.
D.It stops all high-priority processes from running.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Aging raises the priority of a waiting process over time, so no process remains at the bottom forever. Starvation is avoided because each waiting process eventually reaches a priority high enough to be selected. The approach keeps the benefits of priorities while ensuring fairness over time.

Q11. Why is the short-term scheduler invoked much more frequently than the long-term scheduler?

A.Because the short-term scheduler selects the next process for the CPU every few milliseconds, while the long-term scheduler admits new processes much less often. ✅
B.Because the long-term scheduler runs only on disks.
C.Because the short-term scheduler is always idle.
D.Because the two schedulers are the same program with the same frequency.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The CPU must choose a new process whenever the current one blocks, finishes or is preempted, which can happen many times per second. Admitting new jobs into memory is needed far less often. Recognising this difference in frequency clarifies the roles of the two scheduling levels.

Q12. Why does a multilevel feedback queue move a process that uses its full time slice into a lower-priority queue?

A.Because CPU-hungry processes are treated as long jobs, and this lets interactive or I/O-bound processes keep responsive service. ✅
B.Because the operating system wants to delete the process.
C.Because the lower queue is always faster.
D.Because processes cannot run in the top queue.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A process that consistently uses its full quantum behaves like a CPU-bound job, so demoting it approximates shortest job first. Short interactive processes that block frequently remain in higher queues and receive quick service, which balances responsiveness and throughput.

Q13. Why is the choice of time quantum described as a trade-off in round robin scheduling?

A.A very small quantum causes many context switches, while a very large quantum makes the algorithm behave like first come first served with poor response. ✅
B.A quantum affects only printer speed, so no trade-off exists.
C.Small quanta always maximize CPU utilization.
D.Large quanta always eliminate all waiting.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A small quantum improves responsiveness but multiplies the number of switches, adding overhead. A large quantum reduces switching but lets long processes delay short ones. The best value balances these effects, so choosing the quantum requires weighing responsiveness against overhead rather than maximising one factor.

Q14. In a preemptive priority scheduler, what happens when a high-priority process arrives while a lower-priority process is running?

A.The arriving process waits until the running process completes.
B.The running low-priority process is preempted and the high-priority process is dispatched. ✅
C.Both processes run simultaneously on one CPU.
D.The scheduler deletes the high-priority process.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: In a preemptive scheduler the CPU is given to the highest-priority ready process at all times. An arriving process with higher priority interrupts the running process, which returns to the ready queue. This gives urgent work fast service at the cost of extra context switches.

Q15. Processes P1 (burst 8 ms, arrival 0), P2 (burst 4 ms, arrival 1) and P3 (burst 2 ms, arrival 2) are scheduled first come first served. What is the average waiting time?

A.5.00 ms
B.5.67 ms ✅
C.6.33 ms
D.10.33 ms
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Under first come first served, P1 runs 0 to 8 with waiting time 0, P2 runs 8 to 12 with waiting time 8−1=78 - 1 = 7 ms, and P3 runs 12 to 14 with waiting time 12−2=1012 - 2 = 10 ms. The average is (0+7+10)/3≈5.67(0 + 7 + 10) / 3 \approx 5.67 ms. The value 10.33 ms is the average turnaround time, a frequent confusion.

Q16. For the same three processes (P1 burst 8 ms arriving at 0, P2 burst 4 ms arriving at 1, P3 burst 2 ms arriving at 2), what is the average waiting time under non-preemptive shortest job first?

A.4.00 ms
B.5.00 ms ✅
C.5.67 ms
D.7.00 ms
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: P1 starts at time 0 because it is the only arrival, and runs to 8 ms. Then P3 (2 ms) runs 8 to 10 with waiting time 8−2=68 - 2 = 6 ms, and P2 runs 10 to 14 with waiting time 10−1=910 - 1 = 9 ms. The average is (0+6+9)/3=5.00(0 + 6 + 9) / 3 = 5.00 ms, which is lower than the first come first served result.

Q17. Processes P1 (burst 3 ms) and P2 (burst 5 ms) both arrive at time 0 and are scheduled by round robin with a quantum of 2 ms. When does P2 complete?

A.5 ms
B.6 ms
C.7 ms
D.8 ms ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: P1 runs 0 to 2 and returns to the queue with 1 ms left. P2 runs 2 to 4 with 3 ms left, then P1 completes 4 to 5. P2 then runs 5 to 7 with 1 ms left and finishes 7 to 8. Recording each quantum in order is the reliable way to avoid mistakes in multi-step round robin problems.

Q18. A system's CPU is busy for 18 ms out of a 24 ms observation window. What is the CPU utilization?

A.60 percent
B.67 percent
C.75 percent ✅
D.85 percent
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: CPU utilization is the fraction of time the processor performs useful work, here 18/24=0.7518 / 24 = 0.75, which is 75 percent. The idle time of 6 ms does not contribute to utilization, so the calculation shows how much of the observation window was productive.

Q19. A context switch takes 5 microseconds, and the system performs 1000 switches per second. What fraction of each second is consumed by switching overhead?

A.0.5 percent ✅
B.5 percent
C.50 percent
D.0.05 percent
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The total switching time per second is 1000×5=50001000 \times 5 = 5000 microseconds, which is 5 milliseconds. Since a second contains 1,000,000 microseconds, the overhead is 5000/1,000,000=0.0055000 / 1{,}000{,}000 = 0.005, or 0.5 percent. Small per-switch costs become noticeable when switches are very frequent.

Q20. A process has been in the ready queue since time 3 with priority 2 (lower number means higher priority). At time 5, another process arrives with priority 1 in a preemptive priority system. Which process runs at time 5?

A.The process with priority 2, since it arrived first.
B.The process with priority 1, which preempts the running process if one is executing. ✅
C.Neither process runs until time 10.
D.Both run simultaneously on one CPU.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: In a preemptive priority scheduler the process with the highest priority, here the lower number 1, is selected as soon as it is ready. Arrival order does not override priority in this scheme. Remembering which numeric direction means higher priority is essential when working through such scenarios.

Q21. A student says that waiting time and turnaround time are always the same for a process. What is the error?

A.There is no error, because both measure the same interval.
B.Turnaround time includes the process's execution time, while waiting time excludes it, so turnaround equals waiting plus CPU burst. ✅
C.Waiting time is the time spent in the printer only.
D.Turnaround time is always zero.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Turnaround time is the full time from submission to completion, and waiting time is the time spent in queues. The difference is the total CPU and I/O service time. Treating the two as equal omits the execution time from turnaround and produces incorrect performance conclusions.

Q22. A student says that shortest job first always gives the best response time for every interactive user, so round robin is never needed. What is wrong with this reasoning?

A.Nothing is wrong, since shortest job first is always best for interactive systems.
B.Shortest job first can starve long jobs and requires burst predictions, while round robin gives each interactive process regular turns, so the two address different goals. ✅
C.Round robin is only used on printers.
D.Shortest job first cannot run on any system.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Shortest job first optimises average waiting time but can delay long processes indefinitely and depends on accurate burst estimates. Round robin provides predictable responsiveness to every interactive process. The student overlooks these differences and treats one metric as universally decisive.

Q23. A student says that when a time quantum expires, the process moves from the running state to the waiting queue. Which correction is most accurate?

A.The process moves to the printer queue.
B.When the quantum expires, the process is preempted and returns to the ready queue, because it has not requested any event. ✅
C.The process moves to the terminated state.
D.The process stays on the CPU until it finishes.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Quantum expiry is a timer-driven preemption, not a request for an external event, so the process goes back to the ready queue to await its next turn. Waiting is reserved for processes blocked on input, output or another event, so the student confuses the two transitions.

Q24. A student claims that priority scheduling cannot cause starvation because priorities are fixed numbers. What is the flaw in this claim?

A.There is no flaw, since fixed priorities always guarantee service.
B.Fixed priorities can keep low-priority processes waiting indefinitely while higher-priority work continuously arrives, which causes starvation unless aging is used. ✅
C.Priority numbers are stored only on paper.
D.Starvation happens only in disk scheduling.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: If higher-priority processes keep arriving, a low-priority process may never be chosen. Fixed priorities therefore create a real risk of starvation. Aging or similar techniques are used to counter this, so the student's claim overlooks an important weakness of the approach.

Q25. A student says that context switches are free because they only save a few registers, so preemption always costs nothing. Which evaluation is most accurate?

A.The claim is correct because registers are stored without any time.
B.Context switches take real CPU time to save and restore state, so preemption adds overhead that must be counted, even if it is small per switch. ✅
C.Context switches occur only in batch systems.
D.Registers cannot be saved at all.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Even though saving registers is quick, the operation consumes CPU cycles that produce no application work. Across many switches the cost accumulates, and it also includes cache effects. The student's claim treats an operation with real cost as costless, which leads to an unsound conclusion about preemption.

Q26. A Gantt chart shows P1 running from 0 to 4 ms, P2 from 4 to 6 ms, P3 from 6 to 7 ms, and P1 again from 7 to 9 ms. Which statement is correct?

A.P1 was preempted at 4 ms and resumed at 7 ms. ✅
B.P1 finished at 4 ms.
C.P2 ran before P1 started.
D.P3 ran for the longest time.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: P1 runs in two separate intervals with other processes between them, which means it was taken off the CPU at 4 ms and resumed at 7 ms. Reading the Gantt chart this way reveals preemption and the order of execution, which is the purpose of such diagrams.

Q27. A graph plots average response time against round robin quantum size: quantum 1 ms gives 3 ms, quantum 2 ms gives 2 ms, quantum 8 ms gives 6 ms, and quantum 20 ms gives 15 ms. What is the best inference?

A.Response time improves steadily as the quantum grows.
B.Response time is best at a small to moderate quantum, and very large quanta degrade response noticeably. ✅
C.The quantum has no effect on response time.
D.Response time is lowest at the largest quantum.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The response time falls from 3 ms to 2 ms as the quantum increases to 2 ms, then rises sharply at 8 ms and 20 ms. This shows an intermediate optimum: a very large quantum behaves like first come first served and hurts responsiveness. The graph supports choosing a moderate quantum.

Q28. A graph plots CPU utilization against the number of processes. Utilization rises quickly to about 90 percent with the first few processes, then levels off near 95 percent as more are added. What does this suggest?

A.Adding more processes beyond a point yields little additional utilization gain. ✅
B.Utilization is directly proportional to the number of processes without limit.
C.The CPU becomes idle as more processes arrive.
D.Utilization falls to zero after the tenth process.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The plateau near 95 percent indicates diminishing returns: once the CPU is nearly saturated, additional processes add little benefit while increasing contention and switching. The inference relies on the flattening curve rather than on any assumed linear relationship.

Q29. A table shows system throughput for increasing numbers of processes: throughput rises to a peak at 30 processes, then declines at 40 and 50 processes while the number of context switches grows sharply. Which conclusion is best supported?

A.Heavier switching overhead beyond the peak reduces useful work, so performance declines after the optimum. ✅
B.Throughput declines only because the printer is slow.
C.Context switches have no effect on throughput.
D.More processes always increase throughput indefinitely.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The table pairs the drop in throughput with a rapid rise in context switches, suggesting that switching overhead consumes time that could have supported useful work. The conclusion is supported by the coincident trends, showing why there is an optimal level of multiprogramming.

Q30. Which combination best prevents starvation while still approximating shortest job first behaviour?

A.Shortest job first with aging that gradually raises the priority of long-waiting processes. ✅
B.Shortest job first with no aging, so long jobs are always served last.
C.First come first served with the largest burst served first.
D.Round robin with a quantum of zero.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Shortest job first favours short bursts but can starve long jobs. Adding aging gradually increases the priority of waiting processes, so they eventually run. This combination keeps the efficiency of approximating shortest job first while guaranteeing that no process is ignored forever.

Q31. Which statement correctly describes a preemptive priority scheduler?

A.Only the process that started first can ever be preempted.
B.An arriving process with higher priority can interrupt the currently running process, which returns to the ready queue. ✅
C.Processes can never be interrupted once they begin running.
D.Priorities are assigned only after processes finish.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: In a preemptive priority scheduler the CPU always serves the highest-priority ready process, so a newly arriving urgent process can interrupt a running lower-priority one. The interrupted process returns to the ready queue. This is the defining feature that distinguishes preemptive from non-preemptive priority scheduling.

Q32. Which pairing correctly matches a scheduling algorithm with its main characteristic?

A.Round robin with a fixed time quantum for each process in turn ✅
B.First come first served with preemption whenever a process arrives
C.Shortest job first with random selection
D.Multilevel feedback queue with a single queue and no movement between queues
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Round robin assigns a fixed time quantum to each process in rotation. The other pairings contradict the basic definitions: first come first served is non-preemptive, shortest job first selects by burst length rather than randomly, and multilevel feedback queues allow processes to move between levels.

Q33. Four processes each need 6 ms of CPU time, all arrive at time 0, and round robin uses a quantum of 2 ms with no switching cost. When does the last process finish?

A.18 ms
B.20 ms
C.22 ms
D.24 ms ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Each process needs three quanta, and the four processes cycle through the queue, so there are 4×3=124 \times 3 = 12 quanta of 2 ms each. The total is 12×2=2412 \times 2 = 24 ms, and the last quantum belongs to the last process in the cycle, so it finishes at 24 ms. Counting quanta rather than processes avoids the common error.

Q34. A scheduler predicts the next CPU burst using exponential averaging with α=0.5\alpha = 0.5. The previous prediction was 10 ms and the actual most recent burst was 6 ms. What is the predicted next burst?

A.6 ms
B.8 ms ✅
C.10 ms
D.16 ms
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The formula is τn+1=αtn+(1−α)τn\tau_{n+1} = \alpha t_n + (1 - \alpha)\tau_n. Substituting gives 0.5×6+0.5×10=3+5=80.5 \times 6 + 0.5 \times 10 = 3 + 5 = 8 ms. Exponential averaging balances recent behaviour against history, which is how practical schedulers approximate shortest job first without knowing future bursts.

Q35. A dispatcher performs 200 dispatches per second, and each dispatch takes 50 microseconds. What fraction of each second is spent on dispatching?

A.0.1 percent
B.1 percent ✅
C.10 percent
D.50 percent
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Each second the dispatcher spends 200×50=10,000200 \times 50 = 10{,}000 microseconds, which equals 10 milliseconds. Since one second is 1,000,000 microseconds, the fraction is 10,000/1,000,000=0.0110{,}000 / 1{,}000{,}000 = 0.01, or 1 percent. This modelling step shows that even modest per-dispatch costs add up when dispatch frequency is high.

🔗 Related Topics (MCQs)