SJF Scheduling Algorithm - Practice Questions
Question 1
Consider the following processes with their arrival times and burst times. Use the Shortest Job First
(SJF) algorithm to find the waiting time and turnaround time for each process.
Process Arrival Time Burst Time
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Question 2
Given the following processes, determine the Gantt chart, waiting time, and turnaround time using
the SJF scheduling algorithm.
Process Arrival Time Burst Time
P1 0 6
P2 1 2
P3 2 8
P4 3 3
Question 3
Calculate the waiting time, turnaround time, and average waiting time for the processes below using
SJF scheduling.
Process Arrival Time Burst Time
P1 0 7
P2 1 4
P3 2 1
P4 3 5
Question 4
For the given set of processes, use the SJF scheduling algorithm to calculate the completion time,
waiting time, and turnaround time.
Process Arrival Time Burst Time
P1 1 3
P2 2 6
P3 4 1
P4 5 4
Question 5
Using SJF scheduling, calculate the average turnaround time and average waiting time for the
following processes.
Process Arrival Time Burst Time
P1 0 5
P2 1 2
P3 2 3
P4 4 6
P5 5 1
Question 6
Apply the SJF algorithm to determine the order of execution, waiting time, and turnaround time for
each process.
Process Arrival Time Burst Time
P1 0 7
P2 2 4
P3 3 2
P4 5 8
Question 7
Calculate the completion time, waiting time, and turnaround time for the following processes using
SJF scheduling.
Process Arrival Time Burst Time
P1 1 6
P2 3 2
P3 5 4
P4 6 3
Question 8
Using SJF scheduling, find the Gantt chart, waiting time, turnaround time, and average waiting time
for the given processes.
Process Arrival Time Burst Time
P1 0 9
P2 1 4
P3 2 5
P4 3 2
Question 9
For the given processes, apply the SJF scheduling algorithm and calculate the average turnaround
time and average waiting time.
Process Arrival Time Burst Time
P1 1 5
P2 2 3
P3 4 6
P4 5 2
Question 10
Determine the waiting time and turnaround time for the following processes using the SJF
scheduling algorithm.
Process Arrival Time Burst Time
P1 0 4
P2 1 6
P3 2 1
P4 4 3