Computer networking fundamentals are tested in software engineering, DevOps, backend, and cloud roles at Indian companies. System design interviews frequently require understanding TCP, HTTP, DNS, load balancers, and CDNs. This guide covers computer networks interview questions that appear in backend engineer, DevOps engineer, and SDE interviews at Indian product companies in 2026.
OSI model and TCP/IP stack
Networking fundamentals:
1. OSI model (7 layers): Layer 7 - Application: HTTP, HTTPS, FTP, DNS, SMTP: protocols that applications use. Layer 6 - Presentation: data encoding, encryption (TLS/SSL), compression. Layer 5 - Session: managing sessions (establishment, maintenance, termination). Layer 4 - Transport: end-to-end communication; TCP (reliable, ordered, connection-oriented) and UDP (unreliable, connectionless, low latency). Layer 3 - Network: IP addressing and routing; IP protocol; routers operate here. Layer 2 - Data Link: MAC addresses; Ethernet; switches; frames. Layer 1 - Physical: cables, radio waves, bits. Mnemonic: All People Seem To Need Data Processing.
2. TCP/IP stack (4 layers): Application (combines OSI 5-7): HTTP, DNS, SMTP. Transport: TCP, UDP. Internet: IP, ICMP, ARP. Network Interface (combines OSI 1-2): Ethernet, Wi-Fi.
3. TCP three-way handshake: Establishes a connection before data transfer. (1) SYN: client sends SYN with its initial sequence number (ISN). (2) SYN-ACK: server responds with SYN (its own ISN) + ACK (client's ISN + 1). (3) ACK: client acknowledges the server's ISN. Connection is established. Teardown: four-way: FIN → ACK → FIN → ACK. TCP provides: reliable delivery (acknowledgements + retransmission), ordered delivery (sequence numbers), flow control (receiver advertises window size), congestion control (slow start, AIMD).
4. TCP vs UDP: TCP: connection-oriented, reliable, ordered, flow-controlled. Higher overhead (headers, handshake, retransmission). Use for: HTTP/HTTPS, email, file transfer, database connections. UDP: connectionless, unreliable, no ordering. Lower overhead, lower latency. Use for: video streaming (minor packet loss is acceptable), DNS queries (short request-response, retry at application layer), online gaming, VoIP.
HTTP, HTTPS, DNS, and web infrastructure
Application layer protocols tested in SDE interviews:
1. HTTP methods and status codes: GET: retrieve a resource (idempotent, safe). POST: create a resource (not idempotent). PUT: replace a resource (idempotent). PATCH: partial update. DELETE: remove (idempotent). HEAD: same as GET but no response body (check if resource exists). OPTIONS: discover allowed methods. Status codes: 1xx informational, 2xx success (200 OK, 201 Created, 204 No Content), 3xx redirection (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).
2. HTTP/1.1 vs HTTP/2 vs HTTP/3: HTTP/1.1: one request per TCP connection (or keep-alive for reuse); head-of-line blocking (a slow response blocks subsequent responses on the same connection). HTTP/2: multiplexed streams over a single TCP connection (multiple requests in parallel); header compression (HPACK); server push; binary framing. HTTP/3: uses QUIC (UDP-based) instead of TCP; eliminates TCP head-of-line blocking; faster connection establishment (0-RTT); better on lossy mobile networks.
3. HTTPS and TLS: TLS (Transport Layer Security) encrypts data between client and server. TLS handshake: (1) ClientHello: client sends supported TLS versions, cipher suites, random number. (2) ServerHello: server picks version and cipher, sends certificate. (3) Client verifies certificate (validates CA chain, checks expiry, checks hostname). (4) Key exchange: generate a shared secret (using asymmetric encryption to exchange keys, then symmetric encryption for data). (5) Data transfer with symmetric encryption (AES-GCM typically). HTTPS protects confidentiality (eavesdropping), integrity (tampering), and authenticity (certificate verifies the server's identity).
4. DNS resolution: The phone book of the internet. DNS query path for www.hirestepx.com: (1) Browser cache. (2) OS DNS cache. (3) Recursive resolver (your ISP or 8.8.8.8). (4) Root nameserver (knows where .com TLD nameservers are). (5) TLD nameserver (.com NS: knows where hirestepx.com nameservers are). (6) Authoritative nameserver (returns the actual A record: IP address). Caching: each record has a TTL (time to live); cached until TTL expires. Record types: A (IPv4 address), AAAA (IPv6), CNAME (alias to another hostname), MX (mail server), NS (nameserver), TXT (verification, SPF, DKIM).
Load balancers, CDNs, and subnetting
Infrastructure networking for system design interviews:
1. Load balancers: Distribute incoming requests across multiple servers to prevent overload. Types: Layer 4 (transport layer): routes based on IP and TCP/UDP port; fast; no inspection of content (e.g., AWS NLB). Layer 7 (application layer): routes based on HTTP headers, URL path, cookies; enables path-based routing (/api/ to API servers, /static/ to static servers), sticky sessions, SSL termination (e.g., AWS ALB, nginx). Algorithms: round-robin (default), least connections (sends to server with fewest active connections), weighted (send more traffic to higher-capacity servers), IP hash (consistent routing by source IP, used for session affinity without cookies).
2. CDN (Content Delivery Network): Geographically distributed cache of static assets. User requests are served from the nearest CDN edge server (PoP, Point of Presence), reducing latency significantly for users far from the origin. Cache hit: CDN serves from edge without contacting origin. Cache miss: CDN fetches from origin, caches based on Cache-Control headers. Use for: images, videos, CSS, JavaScript bundles. Indian companies use CDN PoPs in Mumbai, Chennai, Hyderabad for low-latency delivery to Indian users (Cloudflare, Akamai, AWS CloudFront, Fastly).
3. IP addressing and subnetting basics: IPv4: 32-bit address written as 4 octets (192.168.1.1). Subnet mask: determines network vs host portion (255.255.255.0 = /24, 24 bits for network, 8 bits for hosts = 256 addresses, 254 usable). CIDR notation: 192.168.1.0/24. Private IP ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, not routable on the public internet (used for internal networks). NAT (Network Address Translation): allows many private IPs to share one public IP. IPv6: 128-bit; solves IPv4 exhaustion; written as 8 groups of 4 hex digits (2001:0db8::1).
4. Common networking tools in debugging: ping: checks if a host is reachable (ICMP echo request). traceroute/tracert: shows the path packets take to a destination and latency at each hop. netstat / ss: shows active network connections and listening ports. dig / nslookup: DNS lookup: resolves a hostname and shows the query path. curl: make HTTP requests from the command line; useful for API debugging. telnet / nc (netcat): test if a specific port is open on a remote host.
Frequently asked questions
Explore more