Skip to content
GuideSphereCareers

Computer Networks · All levels

Computer Networks Interview Preparation: OSI, TCP/IP, HTTP and DNS

Revise networking fundamentals for technical interviews — OSI and TCP/IP layers, TCP vs UDP, the three-way handshake, HTTP/HTTPS, DNS and what happens when you type a URL.

Published 4 Dec 20262 min read

Networking questions often build up to one big one: "What happens when you type a URL into the browser?" Learn the pieces below and you can answer it end to end.

OSI and TCP/IP models

OSI layer Responsibility Examples
7 Application Services for applications HTTP, DNS, SMTP
6 Presentation Encoding, encryption, compression TLS (often placed here), JPEG
5 Session Managing sessions —
4 Transport End-to-end delivery, ports TCP, UDP
3 Network Logical addressing, routing IP, ICMP
2 Data link Frames, MAC addresses Ethernet, Wi-Fi
1 Physical Bits on the medium Cables, radio

The practical TCP/IP model groups these into four layers: application, transport, internet and link.

TCP vs UDP

TCP UDP
Connection Connection-oriented Connectionless
Reliability Ordered, acknowledged, retransmitted No guarantees
Overhead Higher Lower
Use cases Web pages, email, file transfer Video calls, gaming, DNS queries

Three-way handshake: client sends SYN → server replies SYN-ACK → client sends ACK. Connection teardown uses FIN/ACK exchanges.

TCP also provides flow control (don't overwhelm the receiver) and congestion control (don't overwhelm the network).

IP addressing

  • IPv4 addresses are 32-bit (e.g. 192.168.1.10); IPv6 addresses are 128-bit.
  • Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are used inside networks; NAT maps them to a public address.
  • Subnet mask / CIDR — /24 means the first 24 bits are the network part.

Key protocols

  • ARP — finds the MAC address for an IP on the local network.
  • DHCP — automatically assigns IP addresses.
  • ICMP — error and diagnostic messages (used by ping).
  • DNS — translates domain names to IP addresses.

DNS resolution

  1. The browser and OS check their caches.
  2. A recursive resolver (often your ISP's or a public resolver) is asked.
  3. It queries a root server → the TLD server (e.g. .com) → the domain's authoritative server.
  4. The IP address is returned and cached according to its TTL.

HTTP and HTTPS

  • Common methods: GET (read), POST (create), PUT (replace), PATCH (partial update), DELETE.
  • Status code classes: 2xx success, 3xx redirection, 4xx client error (400, 401, 403, 404), 5xx server error.
  • HTTP is stateless; cookies and tokens maintain sessions.
  • HTTPS = HTTP over TLS, which provides encryption, integrity and server authentication via certificates.

What happens when you type a URL?

  1. The browser parses the URL and checks caches.
  2. DNS resolves the domain to an IP address.
  3. A TCP connection is opened (three-way handshake) — or QUIC over UDP for HTTP/3.
  4. A TLS handshake establishes an encrypted session.
  5. The browser sends an HTTP request; the server (possibly via a CDN or load balancer) responds.
  6. The browser parses HTML, fetches CSS/JS/images, builds the DOM and renders the page.

Practice checklist

  • Draw the OSI layers and place five protocols correctly.
  • Explain why video calls prefer UDP.
  • Walk through the URL question in under two minutes.
  • Explain the difference between 401 and 403.
  • #networking
  • #cs-fundamentals
  • #web