InterviewStack.io LogoInterviewStack.io

Transport Layer Protocols Questions

Comprehensive understanding of transport layer protocols, primarily Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), and related protocols used for diagnostics such as Internet Control Message Protocol (ICMP). Candidates should be able to explain TCP as a connection oriented, reliable, ordered, and flow controlled protocol including the three way handshake for connection establishment, the four step connection teardown, retransmission and timeout behavior, and high level congestion control and flow control mechanisms. Describe TCP header structure and key fields used for reliability and ordering. Explain UDP as a connectionless, best effort, lower latency protocol, its datagram model, simple header structure, and trade offs for reliability and ordering. Give real world use cases and justify protocol choice, for example reliable file transfer and web traffic versus low latency streaming, real time voice, and many DNS queries. Discuss port numbers and common service ports such as HTTP port 80, HTTPS port 443, DNS port 53, SSH port 22, and SMTP port 25, and how sockets and ports map to endpoints. Cover practical topics such as when UDP may fall back to TCP, how fragmentation and packet loss affect each protocol, and the role of ICMP for network diagnostics and error reporting.

HardSystem Design
46 practiced
Design a globally distributed messaging service supporting 10 million concurrent long-lived TCP connections (WebSockets). Explain transport-layer concerns: per-node TCP connection limits, load balancer session affinity, NAT timeouts, connection draining during deployments, TLS termination options, and strategies to minimize the impact of cross-region latency and packet loss on user experience.
EasyTechnical
59 practiced
Sketch the TCP header at a high level and describe key fields used for reliability and ordering: sequence number, acknowledgment number, flags (SYN/ACK/FIN/RST), window size, and TCP options (MSS, window scale, SACK permitted, timestamps). For an SRE triaging a performance incident, which header fields are most important and why?
MediumTechnical
66 practiced
An SRE observes that large HTTP responses fail when routed through a particular path but succeed via other routes. Explain fragmentation and Path MTU Discovery (PMTU). Describe the role of the DF (Don't Fragment) bit and ICMP 'fragmentation needed' messages, the problems that occur when ICMP is filtered, and step-by-step debugging and mitigation actions in cloud networks.
MediumTechnical
57 practiced
Implement a simple reliable stop-and-wait protocol over UDP in Python. Provide two functions: send_reliable(socket, dest, payload, timeout) and receive_reliable(socket). Requirements: sequence numbers (0/1), ACK packets, retransmit on timeout, deliver in-order payloads, and handle duplicates. Use Python's socket module in your design and describe expected behavior on packet loss.
HardTechnical
65 practiced
During a rolling deployment of a backend service behind a TCP load balancer, you notice a spike in RST packets and an increase in client-visible errors. Walk through how you'd triage this incident: what logs and metrics to check (load balancer connection logs, server-side logs, kernel TCP counters, tcpdump), deployment behaviors that commonly cause RST spikes, and strategies to minimize client-visible failures during deployments (connection draining, graceful termination, health-check tuning).

Unlock Full Question Bank

Get access to hundreds of Transport Layer Protocols interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.