Last updated: November 2026
Computer networks (CN) is one of the core subjects in fresher tech interviews, along with operating systems, DBMS and OOP. Interviewers want to know if you understand how data actually moves from your laptop to a server and back.
Here are 30 networking questions grouped by topic, with short answers you can explain in under a minute.
What gets asked most: OSI vs TCP/IP model, TCP vs UDP, the three-way handshake, IP addressing and subnetting, DNS, DHCP, HTTP vs HTTPS, and "what happens when you type a URL into the browser".
Models and basics
1. What is a computer network?
Two or more devices connected to share data and resources, such as files, printers or an internet connection. The internet is a network of networks.
2. What are the 7 layers of the OSI model?
| # | Layer | Job | Example |
|---|---|---|---|
| 7 | Application | Services for apps | HTTP, DNS, SMTP |
| 6 | Presentation | Format, encrypt, compress | TLS, JPEG |
| 5 | Session | Open and manage sessions | RPC sessions |
| 4 | Transport | End-to-end delivery | TCP, UDP |
| 3 | Network | Routing between networks | IP, routers |
| 2 | Data link | Delivery within one network | Ethernet, switches, MAC |
| 1 | Physical | Bits on the wire or air | Cables, Wi-Fi signals |
A memory trick from bottom to top: "Please Do Not Throw Sausage Pizza Away".
3. OSI vs TCP/IP model?
OSI has 7 layers and is mainly a teaching model. TCP/IP has 4 layers (Link, Internet, Transport, Application) and is what the internet actually uses. TCP/IP merges OSI's top three layers into one Application layer.
4. What is a protocol?
A set of rules for how devices talk: message format, order and what to do on errors. HTTP, TCP and IP are protocols.
5. LAN vs MAN vs WAN?
LAN covers a small area such as an office. MAN covers a city. WAN covers large distances, like a company's offices across countries. The internet is the biggest WAN.
Transport layer
6. TCP vs UDP?
| TCP | UDP | |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Guaranteed, ordered delivery | No guarantee |
| Speed | Slower, more overhead | Faster, light |
| Used for | Web pages, email, file transfer | Video calls, live streaming, DNS, games |
7. Explain the TCP three-way handshake.
The client sends SYN, the server replies SYN-ACK, and the client sends ACK. Now both sides agree on starting sequence numbers and the connection is open.
8. How does TCP close a connection?
With a four-step exchange: one side sends FIN, the other ACKs, then sends its own FIN, and the first side ACKs. Each direction closes separately.
9. What is flow control vs congestion control?
Flow control stops a fast sender from overwhelming a slow receiver, using the receiver's window size. Congestion control stops senders from overloading the network itself, for example with slow start.
10. What is a port?
A number that identifies a specific app or service on a device. An IP address finds the machine; the port finds the app. Common ones: 80 (HTTP), 443 (HTTPS), 22 (SSH), 53 (DNS).
11. What is a socket?
One end of a network connection, identified by an IP address and port. A connection is defined by the pair of sockets plus the protocol.
IP addressing
12. What is an IP address?
A unique address for a device on a network. IPv4 addresses look like 192.168.1.10. IPv6 addresses are longer, like 2001:db8::1.
13. IPv4 vs IPv6?
IPv4 uses 32-bit addresses, about 4.3 billion in total, which ran short. IPv6 uses 128-bit addresses, which gives an enormous number, and adds simpler headers and built-in support for features such as auto-configuration.
14. Public vs private IP address?
A public IP is reachable on the internet. Private IPs are used inside home or office networks, in ranges such as 10.x.x.x, 172.16–31.x.x and 192.168.x.x.
15. What is NAT?
Network Address Translation lets many devices with private IPs share one public IP. Your home router does this: every phone and laptop at home appears to the internet as one address.
16. What is subnetting?
Splitting one network into smaller ones. A subnet mask such as 255.255.255.0 (or /24) says which part of the address is the network and which part is the host.
17. How many hosts fit in a /24 subnet?
A /24 leaves 8 bits for hosts, so 2⁸ = 256 addresses. Subtract the network and broadcast addresses: 254 usable hosts.
18. MAC address vs IP address?
A MAC address is fixed to the network card and works within one local network. An IP address is logical, can change, and is used for routing across networks.
19. What is ARP?
Address Resolution Protocol finds the MAC address for a known IP address on the local network, by broadcasting "who has this IP?"
Devices
20. Hub vs switch vs router?
- Hub: sends data to every port. Simple and outdated.
- Switch: sends data only to the right device in a network, using MAC addresses (layer 2).
- Router: connects different networks and picks the path, using IP addresses (layer 3).
21. What is a firewall?
A system that allows or blocks traffic based on rules, such as "allow port 443, block everything else from outside".
22. Proxy vs VPN?
A proxy forwards your requests for certain apps, often to filter or cache traffic. A VPN creates an encrypted tunnel for all your device's traffic to another network.
23. What is a load balancer?
A device or service that spreads incoming requests across several servers, so no single server is overloaded and the site stays up if one fails.
Application layer
24. What is DNS?
The Domain Name System turns names like weekday.works into IP addresses. It is the internet's phone book. DNS mostly uses UDP on port 53.
25. What is DHCP?
Dynamic Host Configuration Protocol gives devices an IP address, subnet mask, gateway and DNS server automatically when they join a network.
26. HTTP vs HTTPS?
HTTPS is HTTP over TLS. It encrypts the data and checks the server's identity with a certificate, so others on the network cannot read or change it. HTTP uses port 80; HTTPS uses 443.
27. What are common HTTP methods and status codes?
Methods: GET (read), POST (create), PUT or PATCH (update), DELETE (remove). Status codes: 200 OK, 201 Created, 301 Moved, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Server Error.
28. What is a CDN?
A Content Delivery Network stores copies of files such as images and videos on servers near users, so pages load faster and the main server has less load.
29. Latency vs bandwidth?
Latency is how long one piece of data takes to arrive. Bandwidth is how much data can flow per second. A wide road (bandwidth) can still have a long drive (latency).
30. What happens when you type a URL and press Enter?
- The browser checks its cache, then asks DNS for the site's IP address.
- It opens a TCP connection with the server (three-way handshake).
- It sets up TLS for HTTPS and checks the certificate.
- It sends an HTTP GET request.
- The server, often behind a load balancer and CDN, sends back the response.
- The browser renders the HTML and fetches CSS, scripts and images.
This one question touches almost every topic above, which is why interviewers love it.
How to prepare for the networking round
- Draw the layers and place each protocol and device on them.
- Practise subnetting with a few /24, /26 and /28 examples until it feels quick.
- Try the commands
ping,traceroute,nslookupandcurl -von your own machine. - Revise the other CS subjects: DBMS, OOP and Linux.
Going for a network engineer role instead? Our guide to network engineer roles and skills covers what that job needs. For a full fresher prep list, see interview questions for freshers.
Ready to apply?
See open software engineering roles on Weekday, including fresher-friendly ones, with filters for city and skills.
Frequently asked questions
What are the most important computer networks topics for interviews?
OSI and TCP/IP models, TCP vs UDP, the three-way handshake, IP addressing and subnetting, DNS, DHCP, HTTP vs HTTPS, and what happens when you type a URL.
What is the difference between TCP and UDP?
TCP is connection-oriented and guarantees ordered delivery. UDP is connectionless and faster but gives no guarantee, which suits video calls, streaming and DNS.
What are the 7 layers of the OSI model?
Physical, Data link, Network, Transport, Session, Presentation and Application, from bottom to top.
What is the difference between a switch and a router?
A switch connects devices within one network using MAC addresses. A router connects different networks and routes traffic using IP addresses.
Are networking questions asked in software developer interviews?
Yes, especially for freshers. Basics such as TCP vs UDP, DNS and HTTP are common in technical rounds along with OS and DBMS.




