Computer Networks Interview Questions and Answers

OSI and TCP/IP, HTTP, DNS, routing, TLS and troubleshooting.

Practise 10 random 3 peer-reviewed questions
Computer Networks Interview Syllabus & Preparation Strategy

Whether you are preparing for entry-level Computer Networks interview questions for freshers or senior software engineer interview questions addressing concurrency, scalability, and system architecture, this track provides peer-reviewed model answers with syntax walkthroughs, edge cases, and practical interview tips.

1 What is the difference between TCP and UDP? Easy

TCP and UDP are transport-layer protocols with opposite trade-offs.

TCP is connection-oriented. It sets up a connection with a three-way handshake, numbers every segment, acknowledges delivery, retransmits lost data, orders bytes and applies flow and congestion control. It is used when correctness matters: HTTP, SMTP, SSH and database connections.

UDP is connectionless. It sends independent datagrams with no handshake, acknowledgements or ordering, so delivery is best-effort. It is used when low latency matters more than reliability: DNS, DHCP, VoIP, video streaming and online games. QUIC adds reliability and encryption on top of UDP in user space.

TCP: SYN, SYN-ACK, ACK -> ordered, reliable byte stream
UDP: datagram -> fire and forget

TCP's guarantees cost latency and header overhead; UDP is cheaper but application code must handle loss, duplication and reordering when required.

2 What happens when you type a URL into a browser? Easy

The browser parses the URL, then finds the server's IP: it checks its cache, the OS cache, /etc/hosts, then asks a resolver, which recurses from the root servers through the top-level domain to the authoritative name server. Meanwhile a TCP connection is opened to port 443 with the three-way handshake.

For HTTPS, a TLS handshake follows: the client sends supported ciphers and a random value, the server returns its certificate, they verify it against trusted CAs, agree on keys via ECDHE and switch to encrypted records. Modern TLS 1.3 does this in one round trip.

The browser then sends an HTTP request with method, path, headers and cookies. The server may hit a load balancer, a cache and application code, and returns a status and body. The browser parses HTML, builds the DOM, fetches subresources, builds the CSSOM, runs layout and paint, and executes JavaScript. All of these stages are visible in browser developer tools.

3 Compare the OSI model and the TCP/IP model. Easy

The OSI model is a seven-layer reference model: Physical, Data Link, Network, Transport, Session, Presentation and Application. The TCP/IP model as taught is four layers: Link, Internet, Transport and Application.

OSI                     TCP/IP
7 Application  }        Application (HTTP, DNS, TLS)
6 Presentation }   ->
5 Session      }        Transport (TCP, UDP)
4 Transport             Internet (IP, ICMP)
3 Network               Link (Ethernet, Wi-Fi, ARP)
2 Data Link
1 Physical

OSI is a conceptual framework that names what each layer should do and helps when reasoning about problems and protocols. TCP/IP is the model actually implemented by the Internet, and it merges the upper layers and leaves some OSI concerns, such as encryption, to the application or to TLS. In troubleshooting people still speak in OSI layers: a layer 2 problem means a switching or MAC issue, while layer 7 means the application payload.

Frequently Asked Questions About Computer Networks Interviews

What do hiring managers evaluate in Computer Networks technical rounds?

Technical interviewers look for foundational fluency, idiomatic syntax, clarity when communicating complex logic, and awareness of performance trade-offs (e.g. memory footprint, render performance, and network latency) in production environments.

What are the best interview tips for practicing Computer Networks questions?

Use active recall: summarize each answer in your own words before revealing the model solution. Focus on explaining why a certain approach is chosen rather than just memorizing code syntax.