CS FundamentalsVery hardProduct company interview · GATE level

Processes (times in ms): A (arrival 0, burst 9), B (arrival 1, burst 4), C (arrival 3, burst 6), D (arrival 5, burst 2), E (arrival 8, burst 5). Round Robin with time quantum 3 is used. A newly arrived process joins the tail of the ready queue before a process whose quantum expires at that same instant. When does E complete, and what is the average waiting time?

  1. A. E completes at 24; average waiting time 11.4 ms
  2. B. E completes at 26; average waiting time 11.4 ms
  3. C. E completes at 26; average waiting time 10.2 ms
  4. D. E completes at 21; average waiting time 9.8 ms

Correct answer: B. E completes at 26; average waiting time 11.4 ms

Queue trace: A 0-3 (B and C arrive; queue B, C, A). B 3-6 (D arrives at 5; queue C, A, D, B). C 6-9 (E arrives at 8; queue A, D, B, E, C). A 9-12, D 12-14 (done), B 14-15 (done), E 15-18, C 18-21 (done), A 21-24 (done), E 24-26 (done). Completion times A 24, B 15, C 21, D 14, E 26; waits 15, 10, 12, 7, 13, sum 57, average 11.4 ms. The placement rule matters at t = 3, where C's arrival and A's preemption coincide: putting A ahead of C reorders the whole chart.

More Operating Systems questions

Exams that ask this topic