Computer networking interview questions answer for preparation

Here are 100 computer networking interview questions and answers, spanning fundamentals, protocols, routing, switching, security, and troubleshooting.

Networking Fundamentals

1. What is a computer network?
A set of interconnected devices (computers, servers, routers, switches) that share resources and communicate using agreed-upon protocols.

2. What are the different types of networks based on geographical scope?
PAN (Personal Area Network), LAN (Local Area Network), MAN (Metropolitan Area Network), WAN (Wide Area Network).

3. What is the difference between a LAN and a WAN?
LAN covers a small geographic area (office, building) with high speed and low latency. WAN spans large areas (cities, countries) using leased lines or VPNs, typically with higher latency.

4. What is a topology? Name common network topologies.
Topology describes the physical or logical layout of a network. Common types: Bus, Star, Ring, Mesh, Tree, Hybrid.

5. What are the advantages of a star topology?
Easy to install and manage, centralized control, fault isolation is simple (if one cable fails, only that node is affected). The disadvantage is the central hub/switch is a single point of failure.

6. What is a protocol?
A set of rules governing data communication over a network, covering syntax, semantics, and synchronization.

7. What is bandwidth and throughput?
Bandwidth is the theoretical maximum data transfer capacity of a connection. Throughput is the actual rate of successful data transfer, often lower due to overhead, errors, and congestion.

8. What is latency?
The time it takes for a packet to travel from source to destination. Components include propagation, transmission, queuing, and processing delays.

9. What is jitter?
Variation in packet delay. High jitter can cause problems for real-time applications (voice/video). Buffering is used to smooth it.

10. What is a packet?
A formatted unit of data carried by a packet-switched network. It includes a header (control information) and a payload (data).

OSI & TCP/IP Models

11. What is the OSI model? List its layers.
A conceptual framework with 7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application. (Please Do Not Throw Sausage Pizza Away – mnemonic).

12. What is the TCP/IP model?
A more concise 4-layer model: Application, Transport, Internet, Network Access (or Link). Some models split it into 5 layers (Application, Transport, Network, Data Link, Physical).

13. What are the functions of the Network layer?
Logical addressing (IP), routing (path determination), and packet forwarding between different networks.

14. What is the difference between a MAC address and an IP address?
MAC address is a 48-bit hardware address burned into NIC, used for local network delivery (Data Link layer). IP address is a logical 32-bit (IPv4) or 128-bit (IPv6) address used for global/internetwork routing (Network layer).

15. What is encapsulation?
The process of adding headers (and possibly trailers) as data moves down the layers. E.g., Application data → TCP header → IP header → Ethernet header/trailer.

16. What is the difference between TCP and UDP?
TCP is connection-oriented, reliable (error recovery, sequencing, flow control). UDP is connectionless, lightweight, no guarantee of delivery. TCP for web/email; UDP for streaming/DNS/VoIP.

17. What is a socket?
A combination of an IP address and a port number (e.g., 192.168.1.5:443), used to uniquely identify an endpoint on a host.

18. Which OSI layer does a switch operate at?
Layer 2 (Data Link), though multilayer switches can operate up to Layer 4.

19. Which OSI layer does a router operate at?
Layer 3 (Network).

20. What is the function of the Presentation layer?
Data translation, encryption, and compression. Ensures data from the Application layer of one system can be read by another.

Physical & Data Link Layer

21. What is the purpose of the Physical layer?
Transmission of raw bit streams over a physical medium (cables, fiber, radio). Defines electrical, mechanical, and timing aspects.

22. What are the common types of network cables?
Twisted pair (Cat5e, Cat6 – copper), coaxial cable, fiber optic (single-mode, multi-mode).

23. What is the difference between a hub, a switch, and a router?
Hub: broadcasts data to all ports (dumb, Layer 1). Switch: forwards data based on MAC addresses (Layer 2, intelligent). Router: forwards packets between networks using IP addresses (Layer 3).

24. What is ARP (Address Resolution Protocol)?
A protocol used to map an IP address to a MAC address on a local network. A host broadcasts an ARP request, the owner replies with its MAC.

25. What is a broadcast domain?
The set of all devices that will receive a broadcast frame from any device within the set. Routers separate broadcast domains; switches extend them (unless using VLANs).

26. What is a collision domain?
A network segment where packet collisions can occur. Hubs create a single collision domain. Switches isolate each port as its own collision domain.

27. What is CSMA/CD and CSMA/CA?
CSMA/CD (Collision Detection) is used in wired Ethernet to detect collisions and retransmit. CSMA/CA (Collision Avoidance) is used in Wi-Fi; devices wait for a clear channel and use acknowledgements.

28. What is a MAC address table?
A table in a switch mapping MAC addresses to switch ports. It learns by examining the source MAC of incoming frames.

29. How does a switch forward a frame when it doesn’t know the destination MAC?
It floods the frame out all ports except the receiving one. Once the destination replies, the switch learns its location.

30. What is VLAN (Virtual LAN)?
A logical grouping of network devices within different physical LANs, allowing segmentation of broadcast domains. Configured on managed switches.

Network Layer & IP Addressing

31. What is an IP address?
A numerical label assigned to each device in a network that uses the Internet Protocol for communication.

32. What is the difference between IPv4 and IPv6?
IPv4 is 32-bit (4.3 billion addresses), dotted decimal. IPv6 is 128-bit (huge address space), hexadecimal with colons, built-in security, no broadcast (uses multicast), and auto-configuration.

33. What is a subnet mask?
A 32-bit number dividing an IP address into network and host portions. Example: 255.255.255.0 or /24.

34. How do you calculate the network address?
Perform a bitwise AND between the IP address and the subnet mask.

35. What are the private IP address ranges?
Class A: 10.0.0.0/8, Class B: 172.16.0.0/12, Class C: 192.168.0.0/16.

36. What is loopback address?
127.0.0.1 (IPv4) and ::1 (IPv6). Used to test TCP/IP stack on the local machine.

37. What is APIPA?
Automatic Private IP Addressing (169.254.x.x). Assigned by Windows when a DHCP server is unavailable, allowing local communication only.

38. What is CIDR (Classless Inter-Domain Routing)?
Replaces classful addressing; uses variable-length subnet masking (VLSM) and slash notation to allocate IP addresses more efficiently.

39. What is a default gateway?
The router’s IP address on a local network, to which hosts send packets destined for remote networks.

40. How does a router make forwarding decisions?
Using its routing table, which contains destination networks and next-hop IP addresses. The longest prefix match principle is applied.

41. What is routing?
The process of selecting paths in a network along which to send network traffic.

42. Differentiate between static and dynamic routing.
Static routes are manually configured, simple, and secure but don’t adapt to topology changes. Dynamic routing uses protocols (OSPF, BGP) to automatically adapt to changes.

43. What are common routing protocols?
Interior: RIP (distance vector), OSPF (link state), EIGRP (hybrid). Exterior: BGP (path vector).

44. What is OSPF?
Open Shortest Path First: a link-state IGP using Dijkstra’s algorithm, fast convergence, hierarchical areas, and supports VLSM/CIDR.

45. What is BGP?
Border Gateway Protocol: the protocol that routes traffic across the internet (exterior gateway protocol). Uses path vector, AS numbers, and policies.

46. What is NAT (Network Address Translation)?
Translates private IP addresses to a public IP address for internet access. Types: static NAT, dynamic NAT, PAT (Port Address Translation) / NAT overload.

47. What is a router’s routing table?
A database storing routes to particular network destinations, including directly connected networks, static routes, and dynamically learned routes.

48. What is TTL (Time To Live)?
A field in IP header that limits a packet’s lifetime, decremented at each hop. When it reaches 0, the packet is discarded. Prevents infinite loops.

49. What is fragmentation in IP?
When a packet is too large for the MTU of a network, it is split into smaller fragments, reassembled at the destination. IPv6 does not allow routers to fragment (path MTU discovery).

50. What is ICMP?
Internet Control Message Protocol: used for error reporting and diagnostics (ping, traceroute). Not used for data transfer.

Transport Layer

51. What is TCP three-way handshake?
SYN (client → server), SYN-ACK (server → client), ACK (client → server). Establishes a connection.

52. What is TCP four-way termination?
FIN from one side, ACK from the other, FIN from the second side, ACK. Both sides close independently; connection is fully closed.

53. What is a port number? List common ports.
A 16-bit number identifying a process/service on a host. HTTP:80, HTTPS:443, FTP:21, SSH:22, Telnet:23, SMTP:25, DNS:53, DHCP:67/68, POP3:110, IMAP:143, RDP:3389.

54. What is flow control in TCP?
Mechanism to prevent the sender from overwhelming the receiver. Implemented using a sliding window: receiver advertises window size, sender limits unacknowledged data.

55. What is congestion control?
TCP algorithms that adjust transmission rate based on network congestion. Examples: slow start, congestion avoidance, fast retransmit, fast recovery.

56. What are TCP sequence and acknowledgment numbers?
Sequence number identifies the first byte in the segment. Acknowledgment number indicates the next expected byte. Ensures ordered, reliable delivery.

57. What is the difference between flow control and congestion control?
Flow control is about the receiver’s capacity; congestion control is about the network’s capacity (routers).

58. What is UDP used for?
Real-time applications where speed is more important than reliability: streaming, online gaming, VoIP, DNS queries.

59. Can UDP be reliable?
UDP itself is not reliable, but reliability can be added at the application layer (e.g., QUIC protocol does this).

60. What is a socket?
As before, it’s the IP:Port combination. For TCP, a connection is defined by a pair of sockets (client and server).

Application Layer Protocols

61. What is DNS and how does it work?
Domain Name System: translates domain names to IP addresses. Process: recursive resolver, root servers, TLD servers, authoritative nameservers.

62. What is the difference between DNS recursive and iterative queries?
Recursive: the client expects the resolver to fully resolve the name. Iterative: the server returns a referral, and the client queries the next server.

63. What is DHCP?
Dynamic Host Configuration Protocol: automatically assigns IP addresses, subnet masks, gateways, and DNS servers to hosts. Uses DORA process (Discover, Offer, Request, Acknowledge).

64. What is HTTP?
Hypertext Transfer Protocol: foundation of data communication on the Web. Stateless request-response protocol.

65. What is the difference between HTTP and HTTPS?
HTTPS adds a layer of security via TLS/SSL encryption, using port 443 instead of 80. It authenticates the server and protects data integrity.

66. What are the common HTTP methods?
GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, TRACE. GET retrieves data; POST submits data; PUT replaces a resource; DELETE removes a resource.

67. What are HTTP status codes?
1xx Informational, 2xx Success (200 OK), 3xx Redirection (301 Moved Permanently), 4xx Client Error (404 Not Found), 5xx Server Error (500 Internal Server Error).

68. What is FTP?
File Transfer Protocol: used to transfer files between a client and server. Uses two TCP connections: command (port 21) and data (port 20 or dynamic).

69. What is SMTP?
Simple Mail Transfer Protocol: sends email from client to server and between mail servers. Port 25/587. POP3 and IMAP are used for retrieval.

70. What is Telnet vs. SSH?
Both provide remote CLI access. Telnet (port 23) is unencrypted. SSH (port 22) encrypts all traffic, providing confidentiality and integrity.

71. What is SNMP?
Simple Network Management Protocol: used to monitor and manage network devices (routers, switches). Ports 161/162.

72. What is NTP?
Network Time Protocol: synchronizes clocks of computer systems. Operates over UDP port 123.

Network Security

73. What is a firewall?
A network security system that monitors and controls incoming and outgoing traffic based on predefined security rules. Can be hardware or software.

74. Difference between stateful and stateless firewall.
Stateless filters each packet in isolation based on header fields. Stateful tracks the state of active connections and makes decisions in context (more secure, block unsolicited).

75. What is an IDS and IPS?
Intrusion Detection System (IDS) monitors and alerts. Intrusion Prevention System (IPS) can actively block/drop malicious traffic. Usually placed inline.

76. What is a VPN?
Virtual Private Network: creates a secure, encrypted tunnel across a public network (Internet) to connect remote users or sites.

77. What is encryption?
Encoding data so that only authorized parties can access it. Symmetric (same key, e.g., AES) and asymmetric (public/private key pair, e.g., RSA).

78. What is SSL/TLS?
Cryptographic protocols providing secure communication over a network. TLS is the successor to SSL. Used in HTTPS, VPNs.

79. What is a DDoS attack?
Distributed Denial of Service: an attack that floods the target with traffic from many sources to exhaust resources and make it unavailable.

80. What is ARP spoofing/poisoning?
Sending falsified ARP messages to link the attacker’s MAC address with a legitimate IP (like default gateway), enabling man-in-the-middle attacks.

81. What is a DMZ?
Demilitarized Zone: a physical or logical subnetwork that exposes an organization’s external-facing services to an untrusted network (e.g., internet).

82. What is 802.1X?
A standard for port-based network access control, providing authentication to devices attached to a LAN port or wireless network.

83. What are access control lists (ACLs)?
A set of rules used to filter packets on a router or switch, based on source/destination IP, ports, protocol.

Wireless & Advanced Concepts

84. What are the common Wi-Fi standards?
802.11a/b/g/n/ac/ax (Wi-Fi 6/6E). Each offers different speeds, frequencies (2.4GHz/5GHz/6GHz), and ranges.

85. What is the difference between 2.4 GHz and 5 GHz Wi-Fi?
2.4 GHz has longer range, better penetration, but more interference. 5 GHz has higher speeds but shorter range and less wall penetration.

86. What is SSID?
Service Set Identifier: a human-readable name identifying a wireless network.

87. What is a wireless security protocol?
WEP (insecure), WPA, WPA2 (AES recommended), WPA3 (latest, more secure). WPA2 with 802.1X (Enterprise) is common in businesses.

88. What is a VLAN trunk?
A point-to-point link carrying traffic for multiple VLANs, using tagging (IEEE 802.1Q) to identify VLAN membership.

89. What is Spanning Tree Protocol (STP)?
Prevents loops in Ethernet networks with redundant paths by blocking certain ports, while allowing failover.

90. What is link aggregation (LACP)?
Combining multiple physical ports into one logical link to increase bandwidth and provide redundancy.

91. What is MPLS?
Multi-Protocol Label Switching: a routing technique that uses labels to make forwarding decisions, speeding up traffic and supporting QoS.

92. What is SDN (Software-Defined Networking)?
Decouples the control plane (decision-making) from the data plane (forwarding). A centralized controller manages network devices.

93. What is QoS (Quality of Service)?
Traffic prioritization to ensure that critical applications (voice, video) receive guaranteed bandwidth and low latency.

94. What is jumbo frame?
Ethernet frames with payload size greater than 1500 bytes (typically 9000 bytes), used in high-speed LANs to reduce overhead.

95. What is Power over Ethernet (PoE)?
A technology that carries electrical power along with data on Ethernet cables, powering devices like IP cameras and phones.

96. What is the role of a proxy server?
Acts as an intermediary for requests from clients, providing anonymity, caching, filtering, and access control.

97. What is network address translation (PAT) overload?
Many private IP addresses share a single public IP, differentiating connections by using unique source port numbers.

98. You can’t reach a website. What do you check first?
Physical connectivity (cables, Wi-Fi), check IP configuration (ipconfig/ifconfig), ping localhost, ping default gateway, ping 8.8.8.8 (external IP), then ping domain (DNS check). Use nslookup for DNS issues.

99. How do you troubleshoot intermittent network connectivity?
Check error counters on switch port (CRC errors, collisions), replace cables, check for duplex mismatch, look for loop/STP issues, monitor network utilization, check for interference (wireless).

100. What does a 169.254.x.x IP address mean?
DHCP failed and the host auto-configured an APIPA address. No external network connectivity. Check DHCP server and network cable.

Conclusion

And just like that, the packets have all arrived safely, the handshakes are complete, and your mind is buzzing with a beautiful, alive energy. You didn’t just study networking — you truly connected with it. The OSI layers, the IP addresses, the routing protocols, the little TCP dance — they’re no longer lifeless concepts on a page. They’re pulsing with joy inside you now, ready to pour out in a conversation that feels more like sharing a passion than answering questions.

Feel how vibrant and awake your brain feels. That’s the gift of real understanding — it makes you feel alive, capable, and genuinely excited about the world of networks that quietly holds the internet together. You’re not a passive learner anymore. You’re a participant in that world, and your voice now carries the spark of someone who truly loves what they’ve learned.

Carry this aliveness into your interview. Let your joy shine. Let them see not just a candidate with answers, but a human being who finds genuine wonder in how data travels across the globe. That energy is unforgettable, and it’s yours forever now. Go celebrate this bright, buzzing version of yourself. 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top