CS FundamentalsHardTCS NQT · Infosys interview pattern

Processes (arrival, burst): P1 (0, 8), P2 (1, 4), P3 (2, 2), P4 (3, 5). What is the average waiting time under preemptive SJF (Shortest Remaining Time First)?

  1. A. 5.75
  2. B. 4
  3. C. 9
  4. D. 4.25

Correct answer: D. 4.25

P1 0–1, P2 1–2 (4 < 7), P3 2–4 (2 < 3), P2 4–7, P4 7–12, P1 12–19. Waiting: P1 11, P2 2, P3 0, P4 4 → 17/4 = 4.25. 9 is the average turnaround time.

More Operating Systems questions

Exams that ask this topic