Detect and Recover Gaps in Multicast Market Data Sequences

Last updated: November 29, 2026

Quick Overview

Exchange market data arrives over UDP multicast with sequence numbers. Write a component that delivers packets in order, buffers out-of-order ones, discards duplicates, and reports the missing ranges to request from a retransmission service.

SIG
Software Engineering Fundamentals
Software Engineer
SIG
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Medium

0

0

0 solved


Exchange market data arrives over UDP multicast with sequence numbers. Write a component that delivers packets in order, buffers out-of-order ones, discards duplicates, and reports the missing ranges to request from a retransmission service.

Most exchanges SIG trades on publish feeds over UDP multicast, often as redundant A and B lines, so packet loss, reordering and duplicates are everyday concerns. The interviewer wants to see that you understand why UDP behaves this way and can write a small, correct gap tracker.

What the Interviewer Expects
  • Explain why multicast feeds use UDP and what that gives up
  • Keep the next expected sequence and a buffer of early packets
  • Treat anything below next expected, or already buffered, as a duplicate
  • Flush buffered packets once a gap fills
  • Compute inclusive missing ranges for retransmit requests
  • Mention arbitration between A and B feeds
Key Topics to Cover
UDP multicast
sequence numbers
gap recovery
networking
market data
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would you merge redundant A and B feeds that carry the same sequence numbers?
  • When should you give up waiting on a gap and resync from a snapshot?
  • How do you bound the buffer if a gap never fills?
  • Why not just use TCP for market data?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

on_packet(seq, payload) returns payloads that are now deliverable in order. missing_ranges() returns inclusive (lo, hi) ranges not yet received between the next expected sequence and the highest...

High-Level Design

UDP multicast lets one exchange send to thousands of subscribers with low latency and no per-client state, but it gives no delivery or ordering guarantee. Sequence numbers restore both. Keep `next_seq...


Submit Your Answer
Markdown supported