0
0
Operating Systemsknowledge~5 mins

SJF (Shortest Job First) in Operating Systems - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does SJF stand for in operating systems?
SJF stands for Shortest Job First, a scheduling algorithm that selects the process with the smallest execution time to run next.
Click to reveal answer
beginner
How does SJF scheduling decide which process to run?
SJF chooses the process that requires the least amount of CPU time among the available processes.
Click to reveal answer
intermediate
What is the main advantage of SJF scheduling?
It minimizes the average waiting time for processes, making the system more efficient in handling tasks quickly.
Click to reveal answer
intermediate
What is a major drawback of SJF scheduling?
It can cause starvation, where longer processes may wait indefinitely if shorter jobs keep arriving.
Click to reveal answer
advanced
Is SJF scheduling preemptive or non-preemptive?
SJF can be both: non-preemptive SJF runs a process to completion once started; preemptive SJF (also called Shortest Remaining Time First) can interrupt a running process if a shorter job arrives.
Click to reveal answer
What does SJF scheduling prioritize?
AProcess with the highest priority number
BProcess that arrived first
CProcess with the shortest execution time
DProcess with the longest execution time
Which problem can SJF scheduling cause?
AStarvation of longer processes
BDeadlock
CHigh CPU utilization
DFairness to all processes
What is the main goal of SJF scheduling?
AMinimize average waiting time
BMaximize throughput
CEnsure fairness
DMaximize CPU idle time
In preemptive SJF, what happens if a new shorter job arrives while another is running?
AThe running job continues until completion
BThe running job is interrupted and the shorter job runs
CBoth jobs run simultaneously
DThe new job waits until the running job finishes
Which of these is NOT true about SJF scheduling?
AIt can be preemptive or non-preemptive
BIt can cause starvation
CIt always reduces average waiting time
DIt is easy to know exact job lengths in practice
Explain how the Shortest Job First scheduling algorithm works and its main benefits.
Think about how choosing the smallest task first affects waiting times.
You got /3 concepts.
    Describe the potential problem of starvation in SJF scheduling and why it happens.
    Consider what happens if short tasks keep coming before longer ones get CPU time.
    You got /3 concepts.