Technical Easy Software Engineer Backend DevOps/SRE Mobile

Explain the differences between TCP and UDP, and when you would choose one over the other.

Practise this question with AI feedback

Record your spoken answer or type your response to receive immediate scoring and STAR improvements.

💡 Suggested Approach & Sample Answer

Comparison & Protocols:
- Transport Layer: Both TCP and UDP operate at Layer 4 of the OSI model, multiplexing network communication using port numbers.

1. Transmission Control Protocol (TCP):
- Characteristics: Connection-oriented (established via 3-way handshake: SYN, SYN-ACK, ACK), reliable, ordered, and byte-stream oriented.
- Reliability: Implements sequence numbers, acknowledgments (ACKs), and automatic retransmissions for lost packets.
- Flow & Congestion Control: Uses sliding windows and congestion control algorithms (e.g., Cubic, BBR) to avoid overwhelming the network or receiver.
- Use Cases: Web traffic (HTTP/1.1, HTTP/2), file transfers (FTP), email (SMTP), financial transactions, database connections.

2. User Datagram Protocol (UDP):
- Characteristics: Connectionless, unreliable, unordered, and lightweight datagram-oriented.
- Efficiency: Zero handshake latency, minimal 8-byte header overhead (vs 20-60 bytes for TCP), no retransmission delays.
- Use Cases: Real-time gaming, live audio/video streaming (WebRTC), DNS queries, VoIP, and modern HTTP/3 (QUIC, which implements custom reliability on top of UDP).

🎯 What Interviewers Listen For

How would you answer this in a real interview?

Use our free AI mock practice tool to test your response, analyze speaking pacing, and refine your STAR structure.

🔗 Related Technical Questions