Sanjaay Gowda T S
Broadcom Inc practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Schedule packet queues without starving a small flow

Software engineeringHardConcept

Original practice scenario: A hypothetical network appliance serves flows with different packet sizes. Compare a simple round-robin queue with a byte-aware fair scheduler.

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Fairness should be defined in bytes or service time when packet sizes differ. Serving one packet from each flow per round can allocate very different bandwidth shares.

Work through it

  1. State the desired weights and maximum acceptable delay, then maintain per-flow queues with bounded total memory and an explicit overflow policy.
  2. Use a deficit counter or comparable byte-aware mechanism: add each flow quantum, transmit eligible packets, and carry unused credit across rounds.
  3. Test small packets against large packets, idle-to-active transitions and persistent overload, recording throughput share and tail waiting time.

Tradeoffs to discuss

  • Larger quanta reduce scheduling overhead but can increase short-flow latency; strict priority lowers selected latency while risking starvation.

Common pitfalls

  • Reset or retain unused credit deliberately when a queue becomes empty.
  • Bound queue admission separately from fair service, because a fair scheduler cannot prevent memory exhaustion.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub