Daily iOS
CS fundamentals and algorithms

TCP vs UDP

What's the difference between TCP and UDP? When a packet is lost, what happens under each one?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

TCP is a reliable stream with connection, ordering, and retransmission guarantees; UDP is datagrams with no guarantees. On loss, TCP holds back later data until the retransmit arrives, while UDP just moves on to the next packet.

Share a question