Interview Q&A / Computer Networks

INTERVIEW Q&A · 55 QUESTIONS

Computer Networks interview questions

What happens when you open a website, TCP vs UDP, DNS and HTTP.

  1. What is the difference between TCP and UDP?

    TCP is connection-based and reliable, with ordering, retransmission and flow control, so it suits web pages, email and file transfer. UDP just sends datagrams with no guarantees, so it is faster and lighter and suits video calls, games, DNS and live streaming.

    BeginnerIn-depth3 min read
  2. What do the TCP flags SYN, ACK, FIN and RST mean?

    SYN starts a connection and syncs sequence numbers, ACK acknowledges received data, FIN politely closes one direction, and RST aborts the connection immediately. PSH asks the receiver to hand data to the app without waiting.

    BeginnerQuick answer1 min read
  3. What is HTTP keep-alive, and why does it speed up page loads?

    Keep-alive reuses one TCP connection for several HTTP requests instead of opening a new one each time. This saves the handshake round trips (and the TLS handshake for HTTPS) for every file after the first. It is the default in HTTP/1.1.

    BeginnerQuick answer1 min read
  4. When would you choose UDP over TCP? Give real examples.

    Choose UDP when speed and low delay matter more than perfect delivery, or when the app wants its own control: live video calls, online games, DNS lookups, and streaming. Old data is useless in real time, so waiting for a retransmission is worse than skipping it.

    BeginnerQuick answer1 min read
  5. Why does TCP use a three-way handshake, and why not two?

    The handshake lets both sides agree on starting sequence numbers and confirm that each can send and receive. Two steps would prove only that the server can hear the client, so a delayed old SYN could make the server open a connection nobody wants.

    BeginnerQuick answer1 min read