CS FundamentalsHardTCS NQT · Infosys interview pattern

Processes (arrival, burst, priority — lower number is higher priority): P1 (0, 5, 3), P2 (1, 3, 1), P3 (2, 4, 4), P4 (4, 2, 2). Under preemptive priority scheduling, at what time does P1 complete?

  1. A. 5
  2. B. 8
  3. C. 14
  4. D. 10

Correct answer: D. 10

P1 runs 0–1, then P2 (priority 1) preempts and runs 1–4. At 4, P4 (priority 2) beats P1 and runs 4–6. P1 resumes 6–10 with its remaining 4 units. P3 runs last, 10–14. 8 forgets P4’s preemption.

More Operating Systems questions

Exams that ask this topic