Simulate Go-Back-N Retransmission Over a Lossy Link
Last updated: November 29, 2026
Quick Overview
Write a discrete-time simulation of a sender using a sliding window of size W with cumulative ACKs and a retransmission timeout over a link that drops given packets; report the order of transmissions and the total time to deliver all segments.
0
0
0 solved
Write a discrete-time simulation of a sender using a sliding window of size W with cumulative ACKs and a retransmission timeout over a link that drops given packets; report the order of transmissions and the total time to deliver all segments.
Infrastructure and networking teams at Google (QUIC, Andromeda, B4) expect a working mental model of transport protocols. The interviewer uses a simulation to test whether you truly understand windows, cumulative ACKs and timeouts, and can contrast Go-Back-N with selective repeat.
What the Interviewer Expects
- Model sender state as base, next sequence number and timer
- Send while next is inside the window
- Advance base on cumulative ACKs and restart the timer
- On timeout resend everything from base
- Explain the wasted bandwidth compared with selective repeat
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 does selective repeat change the receiver and the retransmission count?
- How does TCP's fast retransmit on three duplicate ACKs help here?
- How should the timeout be computed from RTT samples?
- How does the window relate to the bandwidth-delay product?
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
- Segments
0..n-1, windowW, one-way delaydticks (RTT2d), timeoutTticks after the oldest unacked send. - Sender may send one segment per tick.
dropsis a set of(seq, attempt)pai...
High-Level Design
Event-driven over ticks. Each tick: deliver arrivals scheduled for this tick (data at receiver, ACKs at sender), then check the timer, then send at most one segment.
Receiver keeps expected. If a d...