Computer Networks Interview Questions

Models

OSI vs TCP/IP

OSI: 7 layers (physical→application). TCP/IP: 4 layers (link, internet, transport, application). Practical networking references TCP/IP.

Transport

TCP vs UDP

TCP: reliable, ordered, congestion control. UDP: faster, no guarantees. Use TCP for web/API; UDP for streaming/DNS/gaming.

Application

HTTP basics

Methods: GET/POST/PUT/PATCH/DELETE. Status codes: 2xx, 3xx, 4xx, 5xx. Headers, cookies, caching, content negotiation.

Security

TLS/SSL

Encrypts data in transit; uses certs and handshakes to derive session keys. Prevents MITM and snooping.

Naming

DNS and record types

DNS maps names to IPs. Records: A/AAAA (address), CNAME (alias), MX (mail), TXT, NS, SOA.

IP

Routing and NAT

Routers forward packets based on routes. NAT translates private IPs to public. Use CIDR blocks; private ranges: 10.0.0.0/8, 172.16/12, 192.168/16.

Realtime

WebSockets vs HTTP/2/3

WebSockets: full-duplex. HTTP/2: multiplexing over one TCP connection. HTTP/3: QUIC over UDP reducing head-of-line blocking.

IP

CIDR and subnetting

Calculate network/host ranges using CIDR notation; understand masks, subnet sizes, and reserved addresses.

Transport

TCP 3-way handshake

SYN → SYN-ACK → ACK establishes a connection; includes sequence numbers and window sizes for flow control.

Transport

Congestion control

Algorithms like Reno/CUBIC adjust sending rate based on loss/latency to avoid network saturation.

Security

VPN vs Direct Connect

VPNs encrypt over the internet; Direct Connect provides private dedicated links to cloud providers with consistent latency.

IP

IPv6 basics

Larger address space, simplified headers, stateless autoconfiguration; dual-stack deployments coexist with IPv4.