CS FundamentalsVery hardGATE CS · Amazon/Microsoft SDE MCQ

SRTF scheduling (on a tie the running process continues); processes (arrival, burst): P1 (0, 7), P2 (2, 4), P3 (4, 1), P4 (5, 4), P5 (9, 2). What is the average waiting time, and how many context switches occur after the first dispatch?

  1. A. 3.2 and 6
  2. B. 3.2 and 5
  3. C. 2.8 and 6
  4. D. 3.6 and 7

Correct answer: A. 3.2 and 6

Gantt: P1 0-2, P2 2-4, P3 4-5, P2 5-7, P4 7-11 (P5 arrives at 9 tying P4's remaining 2, so P4 continues), P5 11-13, P1 13-18. Waits 11, 1, 0, 2, 2 average 3.2, and the 7 segments mean 6 switches.

More Operating Systems questions

Exams that ask this topic