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

~135s

Round robin with a quantum of 4

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

ProcessBurst time
P124
P23
P33

Under round-robin scheduling with a time quantum of 4, what is the average waiting time?

Show the answer and the worked solution

Correct answer: B.

5.67

Worked solution

  1. The Gantt chart is P1 from 0 to 4, P2 from 4 to 7, P3 from 7 to 10, then P1 again from 10 to 30.
  2. P1 finishes at 30 with a burst of 24, so it waits 30 − 24 = 6 units.
  3. P2 finishes at 7 with a burst of 3, so it waits 4 units; P3 finishes at 10 with a burst of 3, so it waits 7 units.
  4. The total is 6 + 4 + 7 = 17, so the average is 17 / 3 = 5.67 units.

Answer: 5.67.

The idea

Round robin trades average waiting time for responsiveness. A quantum far larger than every burst degenerates into FCFS, while a tiny quantum spends most of the CPU on context switches.

Shortcut. P2 and P3 finish in their first turn, so they wait 4 and 7; P1 waits only between its first slice and its return, 10 − 4 = 6. The total 17 ÷ 3 = 5.67.

Common trap. 7.00 takes P1's wait as 10, the time it resumes, without subtracting the 4 units it had already run: (10 + 4 + 7) ÷ 3 = 7.

Round robin with a quantum of 4 — Aptitude Question

Round robin with a quantum of 4: 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 round-robin scheduling with a time quantum of 4, what is the average waiting time?

Options

  1. 4.33
  2. 5.67
  3. 6.33
  4. 7.00
Show the answer and the worked solution

Correct answer: B. 5.67

Worked solution

  1. The Gantt chart is P1 from 0 to 4, P2 from 4 to 7, P3 from 7 to 10, then P1 again from 10 to 30.
  2. P1 finishes at 30 with a burst of 24, so it waits 30 − 24 = 6 units.
  3. P2 finishes at 7 with a burst of 3, so it waits 4 units; P3 finishes at 10 with a burst of 3, so it waits 7 units.
  4. The total is 6 + 4 + 7 = 17, so the average is 17 / 3 = 5.67 units.

Answer: 5.67.

The idea

Round robin trades average waiting time for responsiveness. A quantum far larger than every burst degenerates into FCFS, while a tiny quantum spends most of the CPU on context switches.

Shortcut. P2 and P3 finish in their first turn, so they wait 4 and 7; P1 waits only between its first slice and its return, 10 − 4 = 6. The total 17 ÷ 3 = 5.67.

Common trap. 7.00 takes P1's wait as 10, the time it resumes, without subtracting the 4 units it had already run: (10 + 4 + 7) ÷ 3 = 7.

All OS, DBMS & Networks questions · placement mock tests