Operating System Interview Questions · Question 09

What is the difference between preemptive and non-preemptive scheduling?

Interview preparation resource from Gate Smashers.

Interview-ready answer

In preemptive scheduling, the OS may interrupt a running task and give the CPU to another task. In non-preemptive scheduling, a task keeps the CPU until it finishes or blocks voluntarily.

Understand it clearly

Preemption improves responsiveness and lets high-priority or interactive work run quickly, but it causes more context switches and requires careful synchronization around shared data.

Non-preemptive scheduling is simpler and has lower switching complexity, but one long task can delay every task behind it. Round Robin and SRTF are common preemptive algorithms; FCFS and non-preemptive SJF are common non-preemptive examples.

Preemption improves responsiveness because a long-running task cannot keep the CPU indefinitely. Non-preemptive scheduling is simpler and can reduce switching overhead, but one slow or blocked task may delay others. Modern general-purpose systems therefore normally use preemptive scheduling.

Quick comparison
BasisPreemptiveNon-preemptive
CPU controlOS can interrupt a taskTask runs until block or finish
ResponseBetter responsivenessLong waits are possible
OverheadMore switchingLower switching complexity
ExamplesRR, SRTF, preemptive PriorityFCFS, non-preemptive SJF