Skip to the page

Computer networks · Trade-off

TCP or UDP for four apps

The interviewer asks

For each of these, would you use TCP or UDP, and why: a file download, a live video call, an online multiplayer game, and a DNS lookup?

Then

Follow-ups the interviewer asks next

  1. What does TCP give you that UDP doesn't?
  2. If UDP can lose packets, how does a video call cope?
  3. Why would a game rather drop old data than wait for it?
  4. HTTP/3 runs on UDP. Why, when web pages need every byte?
  5. What are flow control and congestion control, in one line each?

The answer

What a strong answer covers

  • TCP: a connection with a handshake; reliable, in-order delivery with acknowledgements and resending; flow and congestion control. The cost: setup time, extra messages, and one lost packet holds up everything behind it.
  • UDP: no connection, no guarantee of delivery or order, an 8-byte header, low delay. The application decides what to do about loss.
  • File download: TCP, because every byte must arrive correctly.
  • Video call: UDP (calls in browsers use RTP over UDP). A late frame is useless, and the codec hides small losses.
  • Multiplayer game: UDP for positions, since the newest position matters more than an old one; the game adds its own resending for important events like a purchase.
  • DNS: UDP port 53 for normal lookups (one small question, one small answer), switching to TCP for large answers and zone transfers.
  • HTTP/3 uses QUIC, which runs on UDP and adds its own reliability and encryption. It avoids one lost packet blocking every stream, sets up faster, and can be improved inside apps without waiting for operating-system updates.
  • Flow control stops the sender from overwhelming the receiver (the window). Congestion control stops it from overwhelming the network (slow start, backing off after loss).

The red pen

Common traps

Avoid:"UDP is unreliable, so it's bad"; "TCP is slow, so games never use it"; not knowing DNS uses UDP.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview