All mock tests are FREE till 31 December — register to save your progress

For the following set of processes scheduled using FCFS policy, determine the average waiting time. Assume that the processes arrived in the order P1, P2, P3, P4.
ProcessBurst Time (ms)
P18
P215
P310
P47

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 16

Explanation

Under FCFS with all processes effectively ready together and served strictly in arrival order P1-P2-P3-P4, each process's completion time is the running sum of burst times: P1 completes at 8, P2 at 8+15=23, P3 at 23+10=33, P4 at 33+7=40. Waiting time = completion time − burst time (since arrival time is 0 for all): P1 = 8−8 = 0, P2 = 23−15 = 8, P3 = 33−10 = 23, P4 = 40−7 = 33. Average waiting time = (0+8+23+33)/4 = 64/4 = 16 ms, option (ii), illustrating the convoy effect where later processes wait behind every longer job ahead of them.

More Discrete Structures and Optimization questions