CS FundamentalsVery hardGATE CS (PYQ pattern)

A leaky bucket holds at most 5 packets and leaks (sends) 1 packet at the end of every tick. In ticks 1 to 8, packets arrive as 3, 4, 0, 5, 2, 0, 0, 6; arrivals are added at the start of the tick and any that do not fit are dropped, then one packet leaks. How many packets are dropped in total?

  1. A. 9
  2. B. 11
  3. C. 7
  4. D. 8

Correct answer: D. 8

Tracking the occupancy tick by tick (add arrivals, cap at 5 and count overflow, then remove 1): the overflows sum to 8.

More Computer Networks questions

Exams that ask this topic