Multicast Feed Gap Detection With Reorder Tolerance
Last updated: November 29, 2026
Quick Overview
Write a per-channel sequencer for a UDP multicast market data feed that delivers packets in sequence order, drops duplicates from the A/B lines, buffers early packets, and emits retransmission requests for missing ranges once the gap exceeds a tolerance.
Virtu Financial
November 29, 20260
0
0 solved
Write a per-channel sequencer for a UDP multicast market data feed that delivers packets in sequence order, drops duplicates from the A/B lines, buffers early packets, and emits retransmission requests for missing ranges once the gap exceeds a tolerance.
Exchange feeds that Virtu consumes publish on redundant A and B multicast lines, and packets can be lost or reordered by the network. The interviewer checks in-order delivery, duplicate arbitration, and that you avoid flooding the retransmit server with repeat requests.
What the Interviewer Expects
- Track the next expected sequence number and buffer anything ahead of it
- Drop packets below the expected sequence or already buffered (line arbitration)
- Wait for a small reorder tolerance before declaring a gap
- Coalesce missing sequence numbers into ranges and never request the same one twice
- Flush the buffer as soon as the gap fills
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- When would you abandon retransmission and request a full snapshot instead?
- How would you bound memory if a channel stalls for a long time?
- How would you tune the tolerance per venue?
- What do you do with the book while a gap is outstanding?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
on_packet(seq, payload) returns (delivered, ranges). Delivered payloads are strictly in sequence order. A gap is reported when the highest buffered sequence is at least tolerance beyond the next...
High-Level Design
State: next_seq, a dict of buffered packets, and a set of sequence numbers already requested. Duplicates are cheap to reject. After inserting, drain consecutive packets from next_seq. If the buffe...