Interview Q&A / Computer Networks
Computer Networks interview questions
What happens when you open a website, TCP vs UDP, DNS and HTTP.
Prefer rapid revision? Practise Computer Networks short interview answers →
- What is the difference between static and dynamic routing?
Static routes are entered by hand and never change unless an admin edits them. Dynamic routing uses protocols like OSPF and BGP so routers learn routes from each other and adapt automatically when links fail.
BeginnerQuick answer1 min read - How does a router choose between several matching routes? Explain longest prefix match.
The router picks, among all table entries that contain the destination address, the one with the longest prefix (most specific). A /24 beats a /16, which beats a /8, and 0.0.0.0/0 is the last-resort default route.
IntermediateQuick answer1 min read - What changes in a packet as it passes through routers?
The IP source and destination stay the same (without NAT), but each router decrements the TTL by 1 and the Ethernet frame is rebuilt with new source and destination MAC addresses for the next link.
IntermediateQuick answer1 min read - What is route summarization? Summarize 192.168.0.0/24 and 192.168.1.0/24.
Summarization replaces several contiguous routes with one shorter-prefix route. 192.168.0.0/24 and 192.168.1.0/24 combine into 192.168.0.0/23, which covers 192.168.0.0 to 192.168.1.255, so routers keep one entry instead of two.
IntermediateQuick answer1 min read - What is the difference between distance vector and link state routing protocols?
Distance vector protocols like RIP share their routing table with neighbours and trust what they hear (routing by rumour). Link state protocols like OSPF flood the full network map to everyone, and each router computes shortest paths itself with Dijkstra's algorithm.
IntermediateQuick answer1 min read - What is BGP, and why is it called the routing protocol of the internet?
BGP (Border Gateway Protocol) exchanges routes between autonomous systems, the independently run networks that make up the internet, such as ISPs and large companies. It chooses paths by policy and AS path length, not simply the shortest link.
AdvancedQuick answer1 min read