CS FundamentalsVery hardAmazon · Microsoft MCQ pattern

Processes (arrival, burst) in ms: P1 (arrival 0, burst 10), P2 (arrival 1, burst 3), P3 (arrival 2, burst 7), P4 (arrival 4, burst 2), P5 (arrival 6, burst 6). They are scheduled by preemptive Shortest Remaining Time First (SRTF); ties go to the process that arrived earlier. What are the average waiting time and the average turnaround time?

  1. A. 5.6 ms and 11.2 ms
  2. B. 10.4 ms and 16 ms
  3. C. 6.6 ms and 11.2 ms
  4. D. 5.6 ms and 10.2 ms

Correct answer: A. 5.6 ms and 11.2 ms

Simulating SRTF tick by tick gives completion times P2 4, P4 6, P5 12, P3 19, P1 28; waiting = turnaround − burst, averaging to 5.6 ms waiting and 11.2 ms turnaround. Running the same processes strictly in arrival order (FCFS) instead gives 10.4 ms waiting, the result of ignoring preemption.

More Operating Systems questions

Exams that ask this topic