Reorder Out-of-Sequence Drone Telemetry With a Bounded Buffer
Last updated: November 29, 2026
Quick Overview
Implement a receiver that accepts telemetry packets tagged with sequence numbers, releases payloads strictly in order, drops duplicates and late packets, and when its buffer exceeds a fixed capacity, declares the missing sequence numbers lost and skips ahead.
Zipline
November 29, 20260
0
0 solved
Implement a receiver that accepts telemetry packets tagged with sequence numbers, releases payloads strictly in order, drops duplicates and late packets, and when its buffer exceeds a fixed capacity, declares the missing sequence numbers lost and skips ahead.
Aircraft to cloud links at Zipline are lossy and reorder packets, yet downstream consumers such as flight monitoring expect ordered streams. The interviewer is looking for a clean class design, explicit memory bounds, and a deliberate policy for loss rather than an unbounded wait.
What the Interviewer Expects
- Define clear API semantics for receive and the return value
- Bound memory with an explicit loss policy
- Treat duplicates and already-released packets idempotently
- Record lost sequence numbers for observability
- Write small tests that cover reorder, duplicate and overflow
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you add a timeout so a gap is skipped after N milliseconds even if the buffer is not full?
- Sequence numbers are 16-bit and wrap around; what changes?
- How would you make this safe for multiple producer threads?
- Which metrics would you emit from this component in production?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
receive(seq, payload) returns the payloads that become deliverable, in order. Sequence numbers start at first_seq. A packet with seq < next_seq or already buffered is ignored. At most capacity...
High-Level Design
State: next_seq, a dict of pending packets, and a list of lost seqs. After each insert, drain consecutive packets starting at next_seq. If the buffer is still over capacity, jump next_seq to the...