AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Mediumschedulingfcfs

~105s

Average waiting time under FCFS

Three processes arrive together at time 0, in the order P1, P2, P3:

ProcessBurst time
P124
P23
P33

Under first-come first-served scheduling, what is the average waiting time?

Show the answer and the worked solution

Correct answer: B.

17

Worked solution

  1. FCFS runs the processes in arrival order: P1 from 0 to 24, P2 from 24 to 27, P3 from 27 to 30.
  2. Waiting time is start time minus arrival time, so P1 waits 0, P2 waits 24 and P3 waits 27.
  3. The total waiting time is 0 + 24 + 27 = 51.
  4. The average is 51 / 3 = 17 units.

Answer: 17.

The idea

FCFS is simple but suffers the convoy effect: one long process at the front inflates everybody else's wait. Running the same three in the order P2, P3, P1 would cut the average to 3.

Shortcut. Weight each burst by how many processes queue behind it: 24 × 2 + 3 × 1 + 3 × 0 = 51, and 51 ÷ 3 = 17.

Common trap. 27 is the average completion time, (24 + 27 + 30) ÷ 3, which is turnaround rather than waiting time.

Average waiting time under FCFS — Aptitude Question

Average waiting time under FCFS: Three processes arrive together at time 0, in the order P1, P2, P3: | Process |… Answer and worked solution on CodeKairo.

Question

Three processes arrive together at time 0, in the order P1, P2, P3:

ProcessBurst time
P124
P23
P33

Under first-come first-served scheduling, what is the average waiting time?

Options

  1. 13
  2. 17
  3. 20
  4. 27
Show the answer and the worked solution

Correct answer: B. 17

Worked solution

  1. FCFS runs the processes in arrival order: P1 from 0 to 24, P2 from 24 to 27, P3 from 27 to 30.
  2. Waiting time is start time minus arrival time, so P1 waits 0, P2 waits 24 and P3 waits 27.
  3. The total waiting time is 0 + 24 + 27 = 51.
  4. The average is 51 / 3 = 17 units.

Answer: 17.

The idea

FCFS is simple but suffers the convoy effect: one long process at the front inflates everybody else's wait. Running the same three in the order P2, P3, P1 would cut the average to 3.

Shortcut. Weight each burst by how many processes queue behind it: 24 × 2 + 3 × 1 + 3 × 0 = 51, and 51 ÷ 3 = 17.

Common trap. 27 is the average completion time, (24 + 27 + 30) ÷ 3, which is turnaround rather than waiting time.

All OS, DBMS & Networks questions · placement mock tests