The interview problem

Practice prompt

Voice packets arrive out of order with variable delay. Design a receiver that smooths playback without adding excessive conversational latency.

Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.

1. Scope and assumptions

Assume 20 ms audio packets and a separate decoder. Distinguish network jitter, permanent loss and clock drift. Sender media timestamps are not directly comparable to receiver wall-clock timestamps without a mapping.

2. Architecture and decisions

Packet → sequence validation → reorder buffer → playout deadline → decode or conceal → audio device

Build a local playout timeline from media timestamps and observed arrivals. Estimate a target delay from recent arrival variation, with minimum and maximum bounds. Increase delay cautiously after sustained late arrivals and reduce it slowly to avoid audible discontinuities. Track duplicates and sequence wraparound. Discard a packet that arrives after its useful playout deadline rather than letting the queue grow forever.

Use concealment for missing frames when supported. A retransmission is useful only if it can beat the remaining deadline. Handle long-term clock drift separately through a supported rate adjustment mechanism; simply growing the jitter buffer eventually creates unbounded delay.

3. Work through the example

An assumed 60 ms jitter target buffers three 20 ms frames. A latency budget with 20 ms packetization, 35 ms one-way network delay, 60 ms buffering and 10 ms decoding/output totals 125 ms. Raising the buffer to 100 ms makes the total 165 ms; lower late loss comes at a measurable interaction cost.

4. Failure cases and trade-offs

One extreme delay sample can inflate a naive maximum-based buffer. Aggressive shrinking causes gaps or time compression artifacts. A packet can be received successfully and still be useless because it is late. Adaptive buffering improves robustness but cannot repair sustained bandwidth shortage; congestion control must reduce offered load.

5. Validation and acceptance

Replay traces with burst delay, reordering, duplicates and clock skew. Measure late-discard rate, concealment duration and mouth-to-ear latency. Test the transition back to a stable network, not only reaction to degradation.

6. Follow-ups and self-review

When should you request retransmission instead of concealment? Reward deadline-based handling, separate drift correction and explicit latency accounting.

Sources and related practice

RTP defines sequence and timing information useful to receivers; this adaptive policy and latency budget are original.

Read the primary technical reference

Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.

Continue with Design a live meeting transcription system; Remove loudspeaker echo without removing the user.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.