Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

Three processes arrive at time 0 with CPU bursts 5, 3 and 8. Round-robin scheduling uses a time quantum of 2, a process that is not finished goes to the back of the queue, and the order starts with P1, P2, P3. At what time does P3 finish?

  1. A. 14
  2. B. 19
  3. C. 16
  4. D. 21

Correct answer: C. 16

Simulate the queue slice by slice: each process runs for min(quantum, remaining) and rejoins the back if it still has work. Forgetting the re-queue step gives a much smaller value.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic