💻Technical12 min

Computer Networks Interview Questions

Computer Networks rounds test whether you understand how data actually moves across the internet. Freshers are asked a predictable set: the OSI and TCP/IP models, TCP versus UDP, the lifecycle of typing a URL, DNS, and the HTTP/HTTPS distinction. These are conceptual, not mathematical, so clear explanation beats memorised jargon.

OSI vs TCP/IP — Know Both Stacks

You will be asked to list the OSI layers and map them to TCP/IP. Memorise the seven layers with a mnemonic.

  • OSI (7 layers): Physical, Data Link, Network, Transport, Session, Presentation, Application — mnemonic 'Please Do Not Throw Sausage Pizza Away'.
  • TCP/IP (4 layers): Link, Internet, Transport, Application — the practical model the internet runs on.
  • Know which layer each protocol lives on: IP (Network), TCP/UDP (Transport), HTTP/DNS (Application).

TCP vs UDP — The Reliability Trade-off

This is the single most common networking question. Frame it as reliability versus speed.

  • TCP — connection-oriented, reliable, ordered, does a three-way handshake, has flow and congestion control. Used for web, email, file transfer.
  • UDP — connectionless, no delivery guarantee, no ordering, lower overhead. Used for streaming, gaming, DNS, VoIP.
  • Say it in one line: 'TCP trades speed for reliability; UDP trades reliability for speed.'

What Happens When You Type a URL

The most famous systems question. Narrate the pipeline end to end — depth here impresses.

  • Browser checks cache, then DNS resolves the domain to an IP (recursive lookup through resolver, root, TLD, authoritative servers).
  • A TCP connection is opened to the server (three-way handshake); if HTTPS, a TLS handshake follows.
  • The browser sends an HTTP request; the server responds with HTML.
  • The browser parses HTML, requests CSS/JS/images, builds the DOM and renders the page.

DNS & HTTP/HTTPS

Two application-layer favourites. Be crisp on what DNS does and what TLS adds.

  • DNS is the internet's phonebook — it translates human domain names to IP addresses.
  • DNS record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail).
  • HTTP is stateless and plaintext; HTTPS is HTTP over TLS, adding encryption, integrity and authentication.
  • The TLS handshake exchanges keys so traffic is encrypted before any HTTP data is sent.

Addressing & Subnetting Basics

A lighter area for freshers, but a couple of definitions are expected.

  • IPv4 is 32-bit (~4.3 billion addresses); IPv6 is 128-bit, created to solve exhaustion.
  • A subnet mask splits an IP into network and host portions.
  • Public vs private IP ranges; NAT maps private addresses to a public one.
  • Router works at the Network layer; switch at the Data Link layer; hub at the Physical layer.

Common Interview Questions & Answers

Q1. What is the difference between TCP and UDP?

TCP is connection-oriented and reliable: it establishes a connection with a three-way handshake, guarantees ordered, error-checked delivery, and provides flow and congestion control, which suits web pages, email and file transfer. UDP is connectionless and unreliable: it just fires packets with no handshake, ordering or delivery guarantee, giving lower latency and overhead, which suits live streaming, gaming, VoIP and DNS. In short, TCP trades speed for reliability and UDP does the reverse.

The one-line 'speed vs reliability' summary is what interviewers remember.

Q2. Walk me through what happens when you type a URL and press Enter.

First the browser checks its cache and then resolves the domain to an IP via DNS, querying the resolver and, if needed, the root, TLD and authoritative name servers. It then opens a TCP connection to that IP using the three-way handshake, and for HTTPS performs a TLS handshake to set up encryption. The browser sends an HTTP GET request; the server returns HTML. Finally the browser parses the HTML, fetches linked CSS, JavaScript and images, constructs the DOM and renders the page.

Depth wins here — mention DNS resolution steps, the handshakes, and rendering to show end-to-end understanding.

Q3. What is the OSI model and how does it map to TCP/IP?

The OSI model is a seven-layer reference model — Physical, Data Link, Network, Transport, Session, Presentation and Application — that standardises how systems communicate. The practical TCP/IP model collapses these into four layers: Link, Internet, Transport and Application. For example, OSI's Network layer maps to TCP/IP's Internet layer where IP operates, and OSI's top three layers fold into TCP/IP's Application layer.

Use a mnemonic for the seven layers so you never freeze mid-list.

Q4. What is the difference between HTTP and HTTPS?

HTTP is a stateless application-layer protocol that sends data in plaintext, so anyone on the path can read or tamper with it. HTTPS is HTTP layered over TLS, which performs a handshake to exchange keys and then encrypts all traffic, providing confidentiality, integrity and server authentication via certificates. That is why sensitive sites must use HTTPS.

Name the three guarantees TLS adds — encryption, integrity, authentication.

Q5. What does DNS do and what are common record types?

DNS, the Domain Name System, translates human-readable domain names into the IP addresses machines use, acting as the internet's phonebook through a hierarchical lookup across resolver, root, TLD and authoritative servers. Common records include A for an IPv4 address, AAAA for IPv6, CNAME for an alias to another domain, and MX for mail servers.

Knowing A vs AAAA vs CNAME vs MX by heart is an easy way to stand out.

Common Mistakes to Avoid

Listing OSI layers out of order or forgetting one

Saying UDP is reliable, or that TCP has no ordering

Giving a shallow URL answer that skips DNS or the handshakes

Thinking HTTPS is a different protocol rather than HTTP over TLS

Confusing the devices — router (Network) vs switch (Data Link) vs hub (Physical)

Expert Tips

Lock in a mnemonic for the seven OSI layers so you never stall

Rehearse the 'type a URL' answer end to end — it is the highest-value networking question

Pair every protocol with its layer (IP→Network, TCP→Transport, HTTP→Application)

Keep the 'TCP vs UDP = reliability vs speed' one-liner ready

Pre-Interview Checklist

6 items

Frequently Asked Questions

Is subnetting math asked for freshers?

Occasionally, and usually lightly. Understand what a subnet mask does and public vs private ranges; heavy subnetting calculation is more common for networking-specific roles.

Which networking question is asked most?

TCP vs UDP and 'what happens when you type a URL' are the two most frequent. Prepare both until they are automatic.

Do I need to memorise port numbers?

Knowing a few common ones helps — 80 (HTTP), 443 (HTTPS), 22 (SSH), 53 (DNS) — but deep port memorisation is not expected of freshers.

🎯

Ready to ace your next interview?

Practice with SpeakWell AI. Upload your resume → get resume-based questions → practice with AI interviewers → improve communication → track progress → get instant AI feedback.

Back to all guides