Computer Networks Quick Revision for Placement Interviews: OSI, TCP/IP, Protocols and 25 Must-Know Questions

Computer Networks (CN) questions in interviews are predictable: layers, TCP vs UDP, what happens when you type a URL, and a few protocols. Revise this page the night before your interview and you will be able to answer most of them confidently.
OSI model in one table
| Layer | What it does | Examples |
|---|---|---|
| 7. Application | Services for the user | HTTP, FTP, SMTP, DNS |
| 6. Presentation | Format, encryption, compression | SSL/TLS, JPEG, ASCII |
| 5. Session | Opens, manages and closes sessions | NetBIOS, RPC |
| 4. Transport | End-to-end delivery, ports | TCP, UDP |
| 3. Network | Logical addressing and routing | IP, ICMP, routers |
| 2. Data Link | Frames, MAC addresses, error detection | Ethernet, switches |
| 1. Physical | Bits on the wire | Cables, hubs, signals |
Trick to remember (top to bottom): All People Seem To Need Data Processing.
TCP/IP model
Four layers: Application (OSI 5-7), Transport, Internet (Network) and Network Access (Data Link + Physical). Real networks use TCP/IP; OSI is a teaching model.
TCP vs UDP
| TCP | UDP |
|---|---|
| Connection-oriented (3-way handshake) | Connectionless |
| Reliable: acknowledgements, retransmission | No guarantee of delivery |
| Ordered delivery | Packets may arrive out of order |
| Slower, more overhead | Faster, less overhead |
| Web, email, file transfer | Video calls, gaming, DNS queries, live streaming |
3-way handshake: client sends SYN, server replies SYN-ACK, client sends ACK. Connection closing uses FIN and ACK (4-way).
IP addressing basics
- IPv4 is 32-bit (for example 192.168.1.10); IPv6 is 128-bit, written in hexadecimal.
- Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- Subnet mask separates the network part from the host part. /24 means 255.255.255.0 and gives 254 usable hosts.
- Usable hosts formula: 2^(host bits) – 2 (network and broadcast addresses are reserved).
- NAT lets many private devices share one public IP.
Common protocols and ports
| Protocol | Port | Use |
|---|---|---|
| HTTP | 80 | Web pages |
| HTTPS | 443 | Secure web pages |
| FTP | 20, 21 | File transfer |
| SSH | 22 | Secure remote login |
| SMTP | 25 | Sending email |
| DNS | 53 | Domain name to IP |
| DHCP | 67, 68 | Automatic IP assignment |
| POP3 / IMAP | 110 / 143 | Receiving email |
25 questions interviewers ask
1. What is a computer network? Two or more devices connected to share data and resources.
2. LAN, MAN, WAN? LAN covers a building or campus, MAN a city, WAN a country or the world (the internet).
3. What are network topologies? Bus, star, ring, mesh, tree and hybrid. Star is the most common today.
4. Hub vs switch vs router? A hub sends data to all ports; a switch sends it only to the right device using MAC addresses; a router connects different networks using IP addresses.
5. MAC address vs IP address? MAC is a fixed physical address of the network card (48-bit). IP is a logical address given by the network and can change.
6. What is ARP? It finds the MAC address for a given IP address in a local network.
7. What is DNS? The internet’s phone book: it converts a domain name into an IP address.
8. What is DHCP? It automatically gives IP addresses and other settings to devices joining a network.
9. What happens when you type a URL and press Enter? The browser finds the IP through DNS, opens a TCP connection (and a TLS handshake for HTTPS), sends an HTTP request, the server sends the response, and the browser renders the page.
10. HTTP vs HTTPS? HTTPS is HTTP over TLS: data is encrypted and the server’s identity is verified by a certificate.
11. What is a port? A number that identifies a specific service on a device, like 443 for HTTPS.
12. What is a socket? The combination of IP address and port used as one end of a connection.
13. What is bandwidth vs latency? Bandwidth is how much data can be sent per second; latency is how long one packet takes to reach.
14. What is a firewall? Hardware or software that filters traffic based on rules to block unwanted access.
15. What is a VPN? A secure, encrypted tunnel over the internet between your device and another network.
16. What is ICMP? A protocol for error and diagnostic messages; ping and traceroute use it.
17. What is flow control vs congestion control? Flow control stops a fast sender from overwhelming a slow receiver (sliding window). Congestion control stops senders from overloading the network (slow start, AIMD).
18. What is a sliding window? A method in TCP where the sender can send several packets before needing an acknowledgement.
19. What is subnetting? Dividing one big network into smaller networks for better management and security.
20. What is the difference between a website’s IP and its domain? The IP is the actual address of the server; the domain is a human-friendly name that points to it.
21. What is CSMA/CD? In Ethernet, a device listens before sending and stops and retries if a collision is detected.
22. Unicast, broadcast and multicast? One to one, one to all, and one to a selected group.
23. What is a proxy server? A server that sends requests on behalf of clients, used for caching, filtering and hiding the client’s IP.
24. What is a CDN? A network of servers in many cities that keeps copies of content near users so websites load faster.
25. What is the difference between IPv4 and IPv6? IPv6 has a much larger address space (128-bit), built-in security support and no need for NAT.
Last-minute tips
- Always explain with a real example (YouTube on UDP-like streaming, banking on TCP and HTTPS).
- Be ready to draw the OSI layers and the 3-way handshake.
- Revise Operating System interview questions and DBMS interview questions along with CN; these three come together in most technical rounds.




Doubts? Ask here