What is the difference between TCP and UDP?

Why Interviewers Ask This

This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Networking topics. It also reveals how well you can explain technical ideas to non-experts.

Answer

TCP (Transmission Control Protocol) is a connection-oriented protocol that guarantees reliable, ordered, and error-checked delivery of data. It establishes a connection via a 3-way handshake (SYN → SYN-ACK → ACK), ensures packets arrive in order, retransmits lost packets, and uses flow control and congestion control. It is slower due to this overhead. Use TCP for: web browsing (HTTP/HTTPS), email (SMTP), file transfers (FTP), SSH. UDP (User Datagram Protocol) is connectionless — it sends data without establishing a connection, with no guarantee of delivery, ordering, or error recovery. Much faster and lower overhead. Use UDP for: video streaming, online gaming, VoIP, DNS queries, DHCP — applications where speed matters more than perfect reliability, or that have their own error-handling logic.

Common Mistake

Candidates often give textbook answers here. Interviewers are more impressed when you relate the concept to a specific problem you solved in a real Networking project.