Computer Networking is one of the core CS fundamentals tested across Indian engineering interviews. Freshers face it in TCS and Infosys rounds. Senior engineers face it in backend and DevOps interviews where networking concepts underpin system design. This guide covers every major networking concept with interview-ready answers and explains how they appear in different interview contexts.
OSI model and TCP/IP stack
Q: What are the 7 layers of the OSI model? Physical (bits over wire/wireless), Data Link (MAC addresses, Ethernet, framing), Network (IP addressing, routing), Transport (TCP/UDP, end-to-end reliability), Session (session management), Presentation (encryption, encoding), Application (HTTP, DNS, SMTP, FTP).
Interview tip: The 'real' stack in practice is the TCP/IP 4-layer model: Network Access (combines Physical + Data Link), Internet (IP), Transport (TCP/UDP), Application (HTTP, DNS etc.). Know both but the TCP/IP model is more practically relevant.
Q: What is the difference between TCP and UDP? TCP (Transmission Control Protocol): connection-oriented, reliable (acknowledgements, retransmission), ordered delivery, flow control. Higher overhead. Used for: HTTP, email, file transfer: anything where data integrity matters.
UDP (User Datagram Protocol): connectionless, unreliable (no acknowledgements), no ordering guarantee. Lower overhead, lower latency. Used for: video streaming, DNS lookups, online gaming, VoIP: anything where speed matters more than perfection.
Q: What is the TCP 3-way handshake? Client sends SYN. Server responds with SYN-ACK. Client sends ACK. Connection established. This is why TCP connections have latency overhead: 3 packets must be exchanged before data can flow. HTTP/3 (QUIC) eliminates this with 0-RTT for returning connections.
HTTP/HTTPS and web protocols
Q: What happens when you type 'www.hirestepx.com' in a browser? DNS resolution (browser cache → OS cache → recursive DNS resolver → authoritative DNS → returns IP). TCP connection to the IP (3-way handshake). TLS handshake for HTTPS (certificate exchange, cipher negotiation, key exchange). HTTP GET request sent. Server responds with HTML. Browser parses HTML, requests CSS/JS/images. Page renders.
Q: What is the difference between HTTP/1.1, HTTP/2, and HTTP/3? HTTP/1.1: one request per connection, head-of-line blocking. HTTP/2: multiplexing (multiple requests over one TCP connection), header compression (HPACK), server push. HTTP/3: uses QUIC over UDP instead of TCP, eliminates TCP head-of-line blocking, 0-RTT for returning connections.
Q: What is HTTPS and how does TLS work? HTTPS = HTTP over TLS (Transport Layer Security). The client and server exchange certificates, agree on a cipher suite, and establish session keys via asymmetric encryption. All subsequent data is encrypted with symmetric encryption (faster). The certificate verifies the server's identity via a Certificate Authority.
Q: What is the difference between HTTP GET and POST? GET: retrieve data, parameters in URL, idempotent (repeated calls produce the same result), cached by browsers. POST: submit data, parameters in request body, not idempotent, not cached. Use PUT for full updates, PATCH for partial updates, DELETE for deletion.
DNS, load balancing, and CDN
Q: How does DNS work? DNS (Domain Name System) translates domain names to IP addresses. Resolution: browser cache → OS cache → recursive resolver (your ISP or 8.8.8.8) → root nameservers → TLD nameservers → authoritative nameservers → final IP. TTL (Time to Live) controls how long records are cached.
Q: What is a CDN and how does it work? CDN (Content Delivery Network) is a network of geographically distributed servers that cache static content (images, CSS, JS) closer to users. When a user in Mumbai requests a file, the CDN serves it from its Mumbai edge node instead of a US origin server. Reduces latency and load on origin. Examples: Cloudflare, AWS CloudFront, Akamai.
Q: What is load balancing? Distributes incoming traffic across multiple server instances. Algorithms: Round Robin (equal distribution), Least Connections (routes to least-busy server), IP Hash (routes the same IP to the same server: session stickiness), Weighted Round Robin (different weights for different server capacities).
Q: What is the difference between L4 and L7 load balancing? L4 (transport layer): routes based on IP and port. Faster, cannot inspect content. L7 (application layer): routes based on HTTP content (URL path, headers, cookies). Slower but more flexible: enables path-based routing, A/B testing, and canary deployments.
Frequently asked questions
Practice these questions on HireStepX