Software Engineer
mediumtcp-vs-udp

TCP vs UDP: what’s the difference and when would you use each?

Answer

**TCP** is connection-oriented and reliable (ordered delivery, retransmissions, flow control). **UDP** is connectionless and best-effort (no ordering or delivery guarantee). **Use TCP for:** HTTP/HTTPS, file transfers, email—when correctness matters. **Use UDP for:** VoIP, gaming, streaming—when latency matters more than perfect delivery. **Interview tip:** Mention that modern protocols like QUIC run on UDP while adding reliability at the application/protocol layer.

Related Topics

NetworkingProtocols