Level 1: Bronze
A memorized definition. Not wrong, but it stops there.
TCP is reliable and UDP is fast.
3 stars If you are short on time, start with this one.
In one or two sentences
TCP opens a connection and guarantees order and delivery. UDP just sends datagrams with no connection, which is light.
Say it out loud, or type it below. What you type never leaves this device.
A memorized definition. Not wrong, but it stops there.
TCP is reliable and UDP is fast.
Correct, but too broad or missing context.
TCP gives you connection setup, ordering, retransmission, flow control and congestion control. UDP has none of that, so its header is small and latency is low.
Reaches principle, use and trade-off, with words that invite the next question.
TCP is a byte stream and does not keep message boundaries. It hides loss with retransmission, at the price of later packets waiting for earlier ones. UDP keeps datagram boundaries and leaves loss alone, so the application handles only what it needs. It fits real time audio and games where late data is useless, and short queries such as DNS. Some protocols, like QUIC, build reliability on top of UDP in the application layer. It is a trade between reliability and delay.
These are likely next questions from an interviewer. Think of your answer first, then press the button.
1 / 3
What if you need reliability over UDP?
Implement sequence numbers, acknowledgements and retransmission in the application layer. QUIC is the well known example.
2 / 3
What problem does TCP ordering cause?
If an earlier packet is lost, later packets that already arrived cannot be handed to the application. That is head-of-line blocking.
3 / 3
Why does DNS mostly use UDP?
A query and its answer often fit in one packet, so a connection setup round trip is waste. If the answer is large, the client asks again over TCP.