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
Coding & Algorithms
Software Engineer
Virtu Financial
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

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
sequencing
buffering
A/B line arbitration
gap recovery
market data
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions