What is the 3-way handshake in TCP?

Why Interviewers Ask This

This is a classic screening question for Networking roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.

Answer

The TCP 3-way handshake is the process by which a TCP connection is established between a client and server before any data is exchanged. Step 1: SYN — the client sends a segment with the SYN (synchronize) flag set and a random Initial Sequence Number (ISN). Step 2: SYN-ACK — the server responds with both SYN and ACK flags set, its own ISN, and an acknowledgment of the client's ISN + 1. Step 3: ACK — the client sends an ACK acknowledging the server's ISN + 1. After this, the connection is established and bidirectional data transfer can begin. TCP connection termination uses a 4-way handshake (FIN → FIN-ACK → FIN → FIN-ACK). The handshake establishes sequence numbers for ordered delivery and confirms both sides can send and receive — this is why TCP is reliable but has higher setup latency than UDP.

Pro Tip

Back up your answer with a specific project or situation. Saying 'In my last Networking project, I used this when...' immediately makes your answer more credible and memorable.