Computer Networks interview questions and quick answers
What happens when you open a website, TCP vs UDP, DNS and HTTP.
Review 819 questions and short answers on Computer Networks. Start with real examples below, then search, practise and follow links to full explanations.
Computer Networks: questions worth revising first
These answers come from AI Tapri's existing question bank and published interview guides. Open each answer and read the linked in-depth guide for examples and context.
01How do you check whether two IP addresses are in the same subnet?
Apply the subnet mask to both addresses (bitwise AND). If the network addresses match, they are in the same subnet and can talk directly. If not, traffic must go via the default gateway.
Read the full explanation02What is the difference between cookies, sessions and tokens like JWT?
A cookie is just a small piece of data the browser stores and sends back automatically. A session keeps login state on the server and puts only a random session ID in a cookie. A JWT is a signed token that carries the user's data itself, so the server can verify it without a lookup, but it is harder to revoke before it expires.
Read the full explanation03What 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.
Read the full explanation04How do you divide 192.168.1.0/24 into four equal subnets?
Borrow 2 host bits (2^2 = 4 subnets) to get /26. The subnets are 192.168.1.0/26, .64/26, .128/26 and .192/26, each with 64 addresses and 62 usable hosts.
Read the full explanation05What are DNS over HTTPS and DNS over TLS, and what problem do they solve?
Plain DNS is unencrypted, so anyone on the path can read and alter your lookups. DNS over TLS (port 853) and DNS over HTTPS (port 443) encrypt the query between you and the resolver, hiding what names you look up from the local network.
Read the full explanation06What are the common DNS record types: A, AAAA, CNAME, MX, TXT and NS?
A maps a name to an IPv4 address, AAAA to an IPv6 address, CNAME makes one name an alias of another, MX names the mail servers, TXT holds free text such as verification and SPF data, and NS lists the authoritative name servers for the domain.
Read the full explanation07What is a common pitfall related to "How do you check whether two IP addresses are in the same subnet"?
Comparing only the first three octets regardless of the prefix length.
Read the full explanation08How would you explain "How do you check whether two IP addresses are in the same subnet" in an interview?
"AND each address with the mask and compare network parts. Same result means same subnet, direct delivery. Otherwise the packet is handed to the default gateway. The answer depends on the mask, not on the addresses alone."
Read the full explanationFind your next answer.
Pick a topic, search a keyword, or open a question to reveal the answer.
Computer Networks quick answers
Free to practise. No account needed. Made for quick revision, not rote memorisation.
Keep preparing for Computer Networks
Quick answers help with recall; detailed guides explain the reasoning, examples and common mistakes behind each answer.