BeginnerPhone
2 min

TCP vs UDP

NetworkingProtocols
Advertisement
Interview Question

What are the key differences between TCP and UDP, and when would you use one over the other?

Key Points to Cover
  • TCP: connection-oriented, reliable, ordered packets
  • UDP: connectionless, faster, possible packet loss
  • Use TCP for reliability (HTTP, FTP); UDP for speed (DNS, streaming)
Evaluation Rubric
Explains TCP characteristics30% weight
Explains UDP characteristics30% weight
Provides examples of usage40% weight
Hints
  • 💡Think reliability vs speed.
Common Pitfalls to Avoid
  • ⚠️Confusing the reliability features: Incorrectly attributing guaranteed delivery, ordered packets, or flow control to UDP.
  • ⚠️Lack of specific use cases: Failing to provide clear, industry-standard application examples for both TCP and UDP.
  • ⚠️Not explaining "connection-oriented" or "connectionless": Merely stating these terms without briefly elaborating on their implications (e.g., handshake, state tracking, overhead).
  • ⚠️Ignoring the "why": Not explaining *why* UDP is faster (lower overhead, no retransmissions) or *why* TCP is reliable (ACKs, retransmissions, sequencing).
  • ⚠️Oversimplifying trade-offs: Not clearly articulating that the choice is a balance between reliability/ordering and speed/latency, and that different applications prioritize different aspects.
Potential Follow-up Questions
  • Why is UDP used for DNS?
  • When would TCP be too slow?
Advertisement