What is TCP congestion control?
Why Interviewers Ask This
This is a differentiating question used for senior and lead roles. Interviewers want to see if you can explain not just what happens, but why — and what the trade-offs are in different approaches.
Answer
TCP congestion control prevents senders from overwhelming the network with more traffic than it can handle. TCP uses several mechanisms: Slow Start — begins transmission conservatively with a small congestion window (cwnd), doubling it each RTT until loss occurs or the Slow Start Threshold (ssthresh) is reached. Congestion Avoidance — once ssthresh is reached, cwnd grows linearly (1 MSS per RTT) instead of exponentially. Fast Retransmit — upon receiving 3 duplicate ACKs (indicating a gap in received data), retransmit the missing segment without waiting for a timeout. Fast Recovery — after fast retransmit, reduce ssthresh to cwnd/2 and continue congestion avoidance (do not restart slow start). Modern algorithms: TCP Cubic (default in Linux) — optimized for high-bandwidth, high-latency paths; uses cubic function for cwnd growth. TCP BBR (Google, Linux kernel) — model-based approach using measured bottleneck bandwidth and RTT rather than loss signals; significantly improves throughput on congested and long-fat networks. TCP QUIC (UDP-based) sidesteps TCP congestion limitations.
Pro Tip
This topic has Networking-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.