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.

Google
Software Engineering Fundamentals
Software Engineer
Google
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Hard

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
sliding window
Go-Back-N
cumulative ACK
retransmission timeout
TCP
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 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 Problems
Sample Answer
Requirements
  • Segments 0..n-1, window W, one-way delay d ticks (RTT 2d), timeout T ticks after the oldest unacked send.
  • Sender may send one segment per tick.
  • drops is 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...


Submit Your Answer
Markdown supported