Arbitrate Redundant A And B Market Data Feeds
Last updated: November 29, 2026
Quick Overview
Exchanges publish the same sequenced messages on two redundant feeds, A and B, each of which may drop messages. Given two iterators of (seq, payload) in increasing seq order, yield a single stream in seq order with duplicates removed, and report sequence gaps missing from both feeds.
Point72
November 29, 20260
0
0 solved
Exchanges publish the same sequenced messages on two redundant feeds, A and B, each of which may drop messages. Given two iterators of (seq, payload) in increasing seq order, yield a single stream in seq order with duplicates removed, and report sequence gaps missing from both feeds.
Feed handlers in Point72's market data stack arbitrate A/B multicast lines so that a packet lost on one line is recovered from the other. The phone screen checks two-pointer merging over iterators (not lists), duplicate suppression, and gap reporting, all without loading the feeds into memory.
What the Interviewer Expects
- Consume both iterators lazily with a two-pointer merge
- Emit each sequence number once, preferring whichever arrives first in order
- Track the next expected sequence number and record gaps
- Handle one feed ending early
- Keep memory O(1)
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
- In real feeds packets arrive out of order by a few microseconds: how would you buffer?
- How would you request a retransmission for a gap, and when do you give up and resync from snapshot?
- How would you measure which line is faster and why does it matter?
- Extend the design to k redundant feeds.
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Both feeds carry identical messages tagged with exchange sequence numbers, each in increasing order, either possibly missing some. Output each sequence number once, in order, and emit a gap record for...
High-Level Design
Classic two-pointer merge on the heads of each iterator. Take the smaller head; if both heads carry the same sequence number, advance both so the duplicate is consumed. Keep the next expected sequence...