Autocoder

Computer Networks Interview Questions with Worked Answers and Numericals

Last updated 2026-11-19

Computer networks is a standard subject in campus and technical interviews. Questions start broad (what is the difference between a hub, a switch and a router) and quickly turn to protocols and numbers: transmission delay, stop-and-wait efficiency, minimum frame size. This page covers the general questions and the formula-based ones, with the working shown. Each protocol area has a deeper page linked below.

Read this together with how to crack a computer networks interview for the round-by-round approach. For a fast route into specific layers see OSI model interview questions, TCP/IP interview questions and IP addressing and subnetting.

NumericalsTransmission and propagation delay, stop-and-wait efficiency, window size, minimum frame size
Deeper pagesOSI, TCP/IP, TCP vs UDP, HTTP, DNS, subnetting, routing, security
Questions16

The delay formulas

Computer Networks Interview Questions with Worked Answers and Numericals: questions with worked answers

  1. 1

    What are LAN, MAN and WAN?

    easy

    A LAN (local area network) covers a building or campus, typically Ethernet and Wi-Fi at 100 Mbps to 10 Gbps, owned by one organisation. A MAN (metropolitan area network) spans a city, for example a cable or metro-Ethernet network. A WAN (wide area network) spans countries and continents and uses leased lines or the public internet, with higher latency. The internet is a network of networks connected by routers.

  2. 2

    Differentiate between a hub, a switch and a router.

    easy

    A hub is a layer 1 repeater that copies every incoming signal to all other ports, so all devices share one collision domain. A switch is a layer 2 device that learns MAC addresses and forwards frames only to the right port, giving each port its own collision domain. A router is a layer 3 device that forwards packets between different networks using IP addresses and routing tables, and it separates broadcast domains.

  3. 3

    What is the difference between a MAC address and an IP address?

    easy

    A MAC address is a 48-bit hardware address (like 00:1A:2B:3C:4D:5E) burned into a network interface and used for delivery within one local link. An IP address is a logical address assigned by configuration (32-bit for IPv4, 128-bit for IPv6) used to route across networks. On each hop the MAC addresses change while the IP addresses stay the same, except under NAT.

  4. 4

    Compare circuit switching and packet switching.

    medium

    Circuit switching reserves a dedicated path and bandwidth for the whole call (the old telephone network): guaranteed rate and constant delay, but idle capacity is wasted and setup is needed. Packet switching splits data into packets that share links and are routed independently, using statistical multiplexing: efficient for bursty traffic and robust to failures, but it has queueing delay, jitter and possible loss. The internet uses packet switching.

  5. 5

    Numerical: A 1000-byte packet is sent over a 1 Mbps link between hosts 2000 km apart (propagation speed 2 x 10^8 m/s). Find transmission delay, propagation delay and total time for one packet.

    medium

    Packet size = 1000 x 8 = 8000 bits. Transmission delay = 8000 / 10^6 = 8 ms. Propagation delay = 2 x 10^6 m / (2 x 10^8 m/s) = 10 ms. The last bit arrives after 8 + 10 = 18 ms. Transmission delay depends on bandwidth and size, propagation on distance and medium, so a faster link cuts the first but never the second.

  6. 6

    Numerical: The same 1000-byte packet crosses 3 links of 1 Mbps in series through 2 store-and-forward routers. Ignore propagation, queueing and processing. What is the end-to-end delay?

    medium

    Each router must receive the whole packet before forwarding it, so the packet is transmitted once per link: 3 x 8 ms = 24 ms. In general, N links give N x L / R. For P packets sent back to back the total is (N + P - 1) x L / R because transmissions overlap in a pipeline: 3 packets over 3 links take (3 + 3 - 1) x 8 = 40 ms.

  7. 7

    Numerical: In stop-and-wait, a 1000-byte frame is sent over a 1 Mbps link with a one-way propagation delay of 10 ms. Find the link utilisation.

    medium

    Transmission time Tt = 8 ms and propagation Tp = 10 ms. The sender transmits for 8 ms then waits for the acknowledgement for 2 x Tp = 20 ms (ignoring ACK transmission time). Utilisation = Tt / (Tt + 2 Tp) = 8 / 28 = 28.6 percent, so the effective throughput is about 0.286 Mbps. Equivalently, efficiency = 1 / (1 + 2a) with a = Tp / Tt = 1.25.

  8. 8

    Numerical: For the same link, what sender window size gives 100 percent utilisation in a sliding window protocol?

    medium

    The window must cover the time for a frame to be sent and its ACK to return: W = 1 + 2a = 1 + 2 x 1.25 = 3.5, rounded up to 4 frames. With a window of 4 the sender is still transmitting when the first ACK arrives. With Go-Back-N the sequence number space needs at least W + 1 = 5 values (3 bits), and with Selective Repeat 2W = 8 values (3 bits).

  9. 9

    Numerical: In CSMA/CD Ethernet at 10 Mbps, the maximum round-trip propagation time is 51.2 microseconds. What is the minimum frame size?

    medium

    A sender must still be transmitting when a collision signal returns, so the frame transmission time must be at least the round-trip time. Minimum bits = rate x RTT = 10 x 10^6 x 51.2 x 10^-6 = 512 bits = 64 bytes. That is why Ethernet frames shorter than 64 bytes are padded. A faster network at the same minimum frame size must have a shorter maximum cable length.

  10. 10

    What is ARP and how does it work?

    medium

    The Address Resolution Protocol maps an IPv4 address to a MAC address on the same link. A host that wants to reach an IP on its subnet broadcasts an ARP request (who has this IP) to ff:ff:ff:ff:ff:ff, the owner replies with its MAC by unicast, and the result is cached for a few minutes. For an off-subnet destination the host ARPs for the default gateway instead. ARP has no authentication, which allows ARP spoofing attacks. See network security interview questions.

  11. 11

    What is the difference between a collision domain and a broadcast domain?

    medium

    A collision domain is a set of devices whose transmissions can collide because they share a medium; hubs extend it and each switch port or router interface breaks it. A broadcast domain is the set of devices that receive a layer 2 broadcast; switches forward broadcasts, so it extends across switches and ends at a router (or VLAN boundary). A 24-port switch has 24 collision domains and, without VLANs, one broadcast domain.

  12. 12

    What is NAT and why is it used?

    medium

    Network Address Translation rewrites the source address (and port) of packets from private hosts to a public address as they leave, and keeps a table to map replies back. With port address translation, thousands of devices share one public IPv4 address. It conserves IPv4 addresses and hides internal addressing, but it breaks end-to-end connectivity for inbound connections, so peer-to-peer and servers behind NAT need port forwarding or traversal techniques.

  13. 13

    Differentiate bandwidth, throughput and latency.

    medium

    Bandwidth is the maximum rate a link can carry, in bits per second. Throughput is the rate actually achieved, which is lower because of protocol overhead, loss and congestion. Latency is how long a bit takes to travel from source to destination. A satellite link may have high bandwidth but 600 ms latency, while a short Ethernet cable has low latency, and both matter for interactive applications.

  14. 14

    What do ping and traceroute do, and how does traceroute work?

    medium

    ping sends ICMP echo requests and reports the round-trip time and loss, testing reachability. traceroute (tracert on Windows) discovers the routers on the path by sending probes with TTL starting at 1 and increasing. Each router decrements TTL, and the one that reduces it to zero discards the packet and returns an ICMP time-exceeded message, revealing its address. The probe finally reaches the destination, which replies differently.

  15. 15

    Explain the difference between client-server and peer-to-peer architectures, with examples.

    hard

    In client-server, dedicated servers provide services and clients request them (web, email, databases): central management and security, but the server is a bottleneck and single point of failure unless replicated. In peer-to-peer each node acts as both client and server (BitTorrent, some blockchain networks): capacity scales with the number of peers and there is no central failure point, but discovery, trust and consistency are harder. Many systems are hybrid.

  16. 16

    What happens when you type a URL in the browser, at a high level?

    hard

    The browser resolves the domain name to an IP with DNS, opens a TCP connection to port 443 with a three-way handshake, performs a TLS handshake, sends an HTTP request, the server responds, and the browser renders the page and fetches further resources. Each step maps to a layer from application down to link. The full walk-through is on what happens when you type a URL.

Frequently asked questions

What are the most important networking topics for interviews?

The OSI and TCP/IP layers, TCP versus UDP and the handshake, HTTP and HTTPS, DNS, IP addressing and subnetting, and routing basics. Delay and window numericals matter for written tests.

What is the difference between a gateway and a router?

A router forwards packets between IP networks. A gateway is the node that connects a network to another, often the router, so the default gateway is the router address a host sends off-subnet traffic to. The term also covers protocol translators.

What is a VLAN?

A virtual LAN splits one physical switch network into separate logical broadcast domains, so devices in different VLANs cannot talk at layer 2 and need a router to communicate. It improves security and reduces broadcast traffic.

What is the difference between half duplex and full duplex?

Half duplex allows transmission in both directions but only one at a time (old hubs, walkie-talkies). Full duplex allows simultaneous send and receive, as on modern switched Ethernet, which removes collisions.

Related guides

More in CS Fundamentals Interview Questions

See all in this section