Skills101

Computer Networks · Lesson 7 of 7 · Updated ·

Top Computer Networks Interview Questions — With Short Answers

Revise these before interviews. Give the one-line answer, then an example.

OSI's 7 layers next to TCP/IP's 4 layers with example protocols — the base of many questions

Models and layers

  1. What is the OSI model? A 7-layer reference model: Application, Presentation, Session, Transport, Network, Data link, Physical.
  2. OSI vs TCP/IP? OSI is a 7-layer reference; TCP/IP is the 4-layer practical model the internet uses.
  3. Which layer is TCP / IP / Ethernet? Transport / Network / Data link.
  4. Segment, packet, frame? Units at the transport, network and data link layers.

Addresses

  1. IP vs MAC address? IP: logical, can change, used for routing across networks (layer 3). MAC: physical, burned into the card, used on the local link (layer 2).
  2. What is ARP? Address Resolution Protocol — finds the MAC address for an IP on the local network.
  3. What is DHCP? Automatically gives devices an IP address, subnet mask, gateway and DNS server (steps: Discover, Offer, Request, Acknowledge — "DORA").
  4. What is NAT? Lets many private-IP devices share one public IP.
  5. Private IP ranges? 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
  6. Usable hosts in a /26? 2⁶ − 2 = 62.
  7. What is a default gateway? The router a device sends traffic to when the destination is outside its own network.
  8. IPv4 vs IPv6? 32-bit vs 128-bit; IPv6 removes the need for NAT and has built-in features like autoconfiguration.

Transport

  1. TCP vs UDP? TCP: connection, reliable, ordered, slower. UDP: connectionless, no guarantees, fast.
  2. Three-way handshake? SYN → SYN-ACK → ACK.
  3. Flow vs congestion control? Flow protects the receiver; congestion control protects the network.
  4. What is a port? A socket? A port identifies an application; a socket = IP + port.

Application

  1. HTTP vs HTTPS? HTTPS = HTTP over TLS: encrypted, integrity-checked, server authenticated; port 443 vs 80.
  2. GET vs POST? GET reads, data in the URL, cacheable; POST creates/changes, data in the body.
  3. How does DNS work? Resolver asks root → TLD → authoritative server; answers cached by TTL.
  4. What is a CDN? Servers around the world that cache content close to users for speed.
  5. 401 vs 403? 401 = not authenticated; 403 = authenticated but not allowed.

Devices and security

  1. Hub vs switch vs router? Hub broadcasts (L1); switch forwards by MAC (L2); router routes between networks by IP (L3).
  2. What is a firewall? It allows or blocks traffic using rules (ports, IPs, applications).
  3. What is a VPN? An encrypted tunnel over the internet so your traffic appears to come from the VPN network.
  4. What happens when you type a URL? DNS → TCP → TLS → HTTP request → server → response → render.

Common commands to know

CommandUse
ping google.comis the host reachable? (ICMP)
tracert / traceroutewhich routers the path goes through
ipconfig / ip addryour IP, mask and gateway
nslookup skills101.inDNS lookup
netstat / ssopen connections and ports

Common mistakes

  • Saying MAC addresses are used to route across the internet.
  • Mixing up DHCP (gives IPs) and DNS (names → IPs).
  • Forgetting the − 2 in host counts.

Quick recap

  • Layers: OSI 7, TCP/IP 4. TCP transport, IP network, Ethernet data link.
  • IP (logical, routing) vs MAC (physical, local); ARP links them; DHCP assigns IPs; NAT shares one public IP.
  • TCP vs UDP; HTTP vs HTTPS; DNS resolution; hub vs switch vs router.

Practice what you learned

📝 Quiz: Networks Interview Questions5 questions · instant answers & explanations · +10 XP · counts towards your free certificateTake the quiz →