Quick answer: These 41 Computer Networking interview questions and answers cover what is asked most in network engineer, system administrator, cloud and software engineer interviews: networking basics, the OSI and TCP/IP models, IP addressing and subnetting, transport and application protocols, routing and switching, and network security. Key answers include short code examples.
Read each answer, then close the page and explain it aloud in two or three sentences. That is exactly what interviewers check.
Contents
- Networking Basics
- OSI and TCP/IP Models
- IP Addressing and Subnetting
- Protocols and Services
- Routing and Switching
- Security and Troubleshooting
- How to prepare
- FAQs
1. Networking Basics Interview Questions
Q1. What is a computer network?
A computer network is a group of devices connected to share data and resources, such as files, printers and internet access, using cables or wireless links and agreed rules called protocols.
Q2. What are LAN, MAN and WAN?
A LAN (Local Area Network) covers a small area such as an office or home. A MAN (Metropolitan Area Network) covers a city. A WAN (Wide Area Network) covers large distances, and the internet is the largest WAN.
Q3. What are the common network topologies?
Bus, star, ring, mesh, tree and hybrid. Star topology, where every device connects to a central switch, is the most common in offices because one cable failure affects only one device.
Q4. What is the difference between a hub, a switch and a router?
A hub sends data to every port and works at Layer 1. A switch sends data only to the correct device using MAC addresses and works at Layer 2. A router connects different networks and forwards packets using IP addresses at Layer 3.
Q5. What is bandwidth and what is latency?
Bandwidth is the maximum amount of data that can be sent per second, such as 100 Mbps. Latency is the delay for data to travel from source to destination, usually measured in milliseconds.
Q6. What is the difference between simplex, half-duplex and full-duplex?
Simplex communication goes in one direction only, like a TV broadcast. Half-duplex goes both ways but one at a time, like a walkie-talkie. Full-duplex goes both ways at the same time, like a phone call.
2. OSI and TCP/IP Models Interview Questions
Q7. Explain the OSI model.
The OSI model has seven layers: Physical (bits over the medium), Data Link (frames, MAC addresses), Network (packets, IP addressing and routing), Transport (end-to-end delivery, TCP and UDP), Session (managing sessions), Presentation (encryption, compression, formats) and Application (services such as HTTP and DNS).
Q8. What is the TCP/IP model?
The TCP/IP model has four layers: Network Access (or Link), Internet (IP), Transport (TCP and UDP) and Application (HTTP, DNS, FTP, SMTP). It is the model the internet actually uses.
Q9. What is the difference between the OSI and TCP/IP models?
OSI is a seven-layer reference model used for teaching and troubleshooting. TCP/IP is a four-layer practical model built around real protocols. OSI's top three layers are combined into one Application layer in TCP/IP.
Q10. At which layer do common devices and protocols work?
Hubs and cables at Layer 1, switches and MAC addresses at Layer 2, routers and IP at Layer 3, TCP and UDP at Layer 4, and HTTP, DNS and FTP at Layer 7.
Q11. What is encapsulation?
As data moves down the layers, each layer adds its own header: data becomes a segment (Transport), a packet (Network), a frame (Data Link) and finally bits. The receiver removes the headers in reverse order.
3. IP Addressing and Subnetting Interview Questions
Q12. What is an IP address?
An IP address is a logical address that identifies a device on a network. IPv4 uses 32 bits written as four decimal numbers, such as 192.168.1.10. IPv6 uses 128 bits written in hexadecimal.
Q13. What is the difference between IPv4 and IPv6?
IPv4 has about 4.3 billion addresses and often needs NAT. IPv6 has a vastly larger address space, simpler headers, built-in support for auto-configuration and no need for NAT.
Q14. What are private IP address ranges?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are used inside local networks and are not routed on the internet.
Q15. What are IP address classes?
In the older classful system: Class A (1–126), Class B (128–191), Class C (192–223), Class D (224–239) for multicast and Class E (240–255) for experiments. 127.x.x.x is reserved for loopback. Modern networks use CIDR instead of classes.
Q16. What is a subnet mask?
A subnet mask separates the network part of an IP address from the host part. For example, 255.255.255.0 (/24) means the first 24 bits identify the network and the last 8 bits identify hosts.
Q17. How many usable hosts are in a /26 subnet?
A /26 leaves 6 host bits, giving 2^6 = 64 addresses. Subtract 2 for the network and broadcast addresses, so 62 usable hosts.
Q18. What is CIDR?
Classless Inter-Domain Routing writes networks as an address plus prefix length, such as 192.168.10.0/24, and allows flexible network sizes instead of fixed classes.
Q19. What is a default gateway?
The default gateway is the router address a device uses to send traffic to networks outside its own subnet, such as the internet.
Q20. What is a MAC address and how is it different from an IP address?
A MAC address is a 48-bit hardware address assigned to a network interface and used within a local network at Layer 2. An IP address is a logical Layer 3 address that can change and is used to route traffic between networks.
4. Protocols and Services Interview Questions
Q21. What is the difference between TCP and UDP?
TCP is connection-oriented and reliable: it uses a three-way handshake, acknowledgements, retransmission and ordering. UDP is connectionless and faster but gives no delivery guarantee. TCP suits web and email; UDP suits DNS queries, streaming, gaming and VoIP.
Q22. Explain the TCP three-way handshake.
The client sends SYN, the server replies with SYN-ACK, and the client sends ACK. The connection is then established. Closing a connection uses FIN and ACK messages.
Q23. What is DNS and how does it work?
DNS translates domain names such as engineersrworld.com into IP addresses. The client asks a recursive resolver, which queries root, top-level domain and authoritative name servers, then caches the answer for the time set by the TTL.
Q24. What is DHCP?
DHCP automatically gives devices an IP address, subnet mask, default gateway and DNS server. The process is Discover, Offer, Request and Acknowledge (DORA).
Q25. What is ARP?
ARP (Address Resolution Protocol) finds the MAC address that belongs to an IP address on the local network, by broadcasting a request and receiving a reply from the owner.
Q26. What is NAT?
Network Address Translation lets many devices with private IP addresses share one public IP address. The router rewrites addresses and ports in packets going out and coming back.
Q27. What is the difference between HTTP and HTTPS?
HTTP sends data in plain text on port 80. HTTPS encrypts it with TLS on port 443, protecting it from eavesdropping and tampering, and verifies the server with a certificate.
Q28. What are some common port numbers?
20/21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 67/68 DHCP, 80 HTTP, 110 POP3, 143 IMAP, 443 HTTPS and 3389 RDP.
Q29. What is ICMP and what does ping use?
ICMP carries error and diagnostic messages. Ping sends ICMP Echo Request messages and waits for Echo Replies to test reachability and measure round-trip time.
5. Routing and Switching Interview Questions
Q30. What is routing?
Routing is choosing the path for packets to travel from source to destination across networks. Routers use routing tables built from static routes or dynamic routing protocols.
Q31. What is the difference between static and dynamic routing?
Static routes are configured manually and suit small, stable networks. Dynamic routing protocols such as OSPF, EIGRP and BGP learn and update routes automatically when the network changes.
Q32. What is the difference between distance vector and link state routing?
Distance vector protocols, such as RIP, share their routing tables with neighbours and choose routes by hop count or distance. Link state protocols, such as OSPF, share link information so every router builds a full map and calculates the shortest path.
Q33. What is a VLAN?
A VLAN (Virtual LAN) splits one physical switch into several logical networks, so departments such as HR and Finance are separated for security and to reduce broadcast traffic. Trunk ports carry several VLANs between switches.
Q34. What is the Spanning Tree Protocol?
STP prevents loops in switched networks with redundant links by blocking some ports and keeping a loop-free tree. If an active link fails, a blocked port takes over.
Q35. What is the difference between a broadcast domain and a collision domain?
Each switch port is its own collision domain. A broadcast domain is the set of devices that receive a broadcast; routers and VLANs separate broadcast domains.
6. Security and Troubleshooting Interview Questions
Q36. What is a firewall?
A firewall filters network traffic using rules based on IP addresses, ports, protocols and, in next-generation firewalls, applications and users. It protects internal networks from unwanted access.
Q37. What is a VPN?
A VPN creates an encrypted tunnel over the internet, so remote users or branch offices can connect securely to a private network.
Q38. What is the difference between IDS and IPS?
An IDS (Intrusion Detection System) monitors traffic and raises alerts on suspicious activity. An IPS (Intrusion Prevention System) sits in the traffic path and can block the threat automatically.
Q39. What is a DMZ?
A DMZ is a separate network zone for public-facing servers, such as web and mail servers, so that if one is compromised, the internal network is still protected by the firewall.
Q40. How would you troubleshoot 'no internet' on a computer?
Check the cable or Wi-Fi connection, confirm the IP settings with ipconfig or ip addr, ping the default gateway, ping a public IP such as 8.8.8.8, then test name resolution with nslookup. This isolates whether the problem is local, the gateway, the ISP or DNS.
Q41. Which commands are used for network troubleshooting?
ping (reachability), tracert or traceroute (path), ipconfig or ip addr (IP settings), nslookup or dig (DNS), netstat or ss (connections and ports), arp -a (ARP table) and curl (testing web services).
How to Prepare for a Computer Networking Interview
- Draw the OSI model: know which protocol and device works at each layer.
- Practise subnetting: calculate hosts, network and broadcast addresses quickly.
- Explain a request end to end: what happens when you type a URL in the browser.
- Compare TCP and UDP: with real examples for each.
- Use real tools: ping, traceroute, nslookup and Wireshark.
Next steps: revise operating system interview questions and cyber security interview questions, and see all subjects on our interview questions page.
More interview preparation: see all interview questions, including Python, SQL, SQL query, Java, JavaScript, React, C++, .NET, Spring Boot, Node.js, DSA, OOPs, DBMS, operating system, networking, machine learning, data science, AI, Excel, Power BI, DevOps, manual testing, Selenium, cyber security and HR.
Frequently Asked Questions
Which networking topics are asked most for freshers?
The OSI and TCP/IP models, TCP versus UDP, IP addressing and subnetting, DNS, DHCP, common ports, the difference between a hub, switch and router, and basic troubleshooting.
Is CCNA needed for networking jobs?
CCNA is not mandatory, but it is widely recognised for network support and engineer roles and covers most interview topics.
Are networking questions asked in software interviews?
Yes. Software and cloud interviews often ask about HTTP, DNS, TCP versus UDP and what happens when you type a URL in the browser.
How should I prepare for a networking interview?
Learn the OSI model well, practise subnetting until it is quick, use Cisco Packet Tracer for labs, and be ready to explain a step-by-step troubleshooting approach.