Data Structures & AlgorithmsHardGATE CS · TCS NQT

Four processes need CPU bursts [5, 3, 8, 2] (all arrive at time 0). A round-robin scheduler gives each process up to a quantum of 2 units per turn, in FIFO order. What is the total waiting time over all processes (waiting = completion time − burst)?

  1. A. 30
  2. B. 33
  3. C. 32
  4. D. 37

Correct answer: B. 33

Simulate with a queue: run the front process for min(quantum, remaining) units, and re-enqueue it if work remains. Waiting time is completion minus burst, since all arrive at 0. Changing the quantum changes both the ordering and the totals.

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

Exams that ask this topic