Computer Networks Interview Questions 2026: Top 35 With Answers
Why Networking Questions Appear in Every Tech Interview
Whether you are a DevOps engineer, backend developer, or security engineer — networking is the foundation everything else runs on. Interviewers use networking questions to test depth: do you understand what actually happens, or do you just know the surface-level answer?
OSI and TCP/IP Model (Q1-Q8)
Q1: What are the layers of the OSI model?
Physical (bits on wire), Data Link (MAC addresses, Ethernet frames), Network (IP routing), Transport (TCP/UDP, ports), Session (connection management), Presentation (encoding, encryption), Application (HTTP, DNS, SMTP). Mnemonic: Please Do Not Throw Sausage Pizza Away.
Q2: What is the difference between TCP and UDP?
TCP: connection-oriented (3-way handshake), reliable (acknowledgements, retransmission), ordered delivery, flow control. Slower but guaranteed. Use for: HTTP, SSH, email.
UDP: connectionless, no acknowledgements, no ordering, fastest. Use for: video streaming, DNS queries, online gaming, VoIP — where speed matters more than reliability.
Q3: Explain the TCP 3-way handshake.
Client sends SYN (I want to connect, my sequence number is X). Server responds SYN-ACK (acknowledged, my sequence number is Y). Client sends ACK (acknowledged). Connection established. This takes one round-trip time before any data is sent — why HTTP/2 and QUIC matter for performance.
IP Addressing and DNS (Q9-Q18)
Q9: What is the difference between a public and private IP address?
Private IP ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Not routable on the public internet. Used inside networks (home, corporate). NAT (Network Address Translation) translates private IPs to a public IP for internet access.
Q10: What is DNS and how does DNS resolution work?
DNS maps domain names to IP addresses. Resolution: (1) Check browser cache. (2) Check OS cache (/etc/hosts). (3) Ask Recursive Resolver (ISP or 8.8.8.8). (4) Resolver asks Root Nameserver for .com TLD server. (5) Resolver asks .com TLD server for example.com nameserver. (6) Resolver asks example.com nameserver for the A record. (7) IP returned and cached.
Q11: What is DHCP?
Dynamic Host Configuration Protocol automatically assigns IP addresses, subnet masks, gateways, and DNS servers to devices on a network. Without DHCP, every device would need manual static configuration.
HTTP and Web (Q19-Q28)
Q19: What is the difference between HTTP and HTTPS?
HTTP sends data in plain text — anyone on the network can read it. HTTPS uses TLS to encrypt data between client and server. The TLS handshake: client says hello with supported cipher suites, server sends certificate (contains public key), client verifies certificate against trusted CAs, they negotiate a symmetric session key, all subsequent data encrypted with that key.
Q20: What is a CDN?
Content Delivery Network — geographically distributed servers that cache static content (images, JS, CSS, videos) close to users. Instead of every Indian user loading assets from a US server (200ms latency), they load from a Cloudflare or AWS CloudFront edge node in Mumbai (10ms). Dramatically improves page load times globally.
Q21: What are HTTP status codes?
2xx: Success (200 OK, 201 Created, 204 No Content). 3xx: Redirect (301 Moved Permanently, 302 Found, 304 Not Modified). 4xx: Client Error (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests). 5xx: Server Error (500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout).
Firewalls, Load Balancers, and Security (Q29-Q35)
Q29: What is a load balancer?
Distributes incoming traffic across multiple backend servers to prevent any single server from being overwhelmed. Load balancing algorithms: Round Robin (each server in turn), Least Connections (send to least busy server), IP Hash (same client always goes to same server — useful for sessions). Layer 4 (TCP/UDP routing) or Layer 7 (HTTP routing — can route based on URL path, headers).
Q30: What is the difference between a firewall and a WAF?
Firewall: filters traffic based on IP addresses, ports, and protocols (Layer 3/4). Blocks entire IP ranges or ports. WAF (Web Application Firewall): filters HTTP traffic for malicious content at the application layer — SQL injection, XSS, OWASP Top 10 attacks. Both are needed: firewall for network security, WAF for application security.
Q31: What is a VPN?
Creates an encrypted tunnel between your device and a remote network. Corporate VPN allows remote employees to securely access internal resources. VPN encrypts traffic at the IP level — your ISP cannot see what sites you visit, though the VPN provider can.
See Computer Networks Academy for complete networking guide.
Found this useful? Share it:
Weekly DevOps & Cloud digest
Every Sunday — tutorials, interview questions, tips, and what changed in DevOps and Cloud this week.

