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 →
- How does DNS resolution work, step by step?
Your device asks a recursive resolver, which checks its cache and, if needed, asks a root server, then the TLD server (like .com), then the domain's authoritative server, which returns the IP address. Every answer carries a TTL, so resolvers and devices cache it and skip most of these steps next time.
IntermediateIn-depth4 min read - What 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.
IntermediateQuick answer1 min read - What is the difference between a recursive and an iterative DNS query?
In a recursive query, the client asks a resolver to do all the work and return a final answer. In an iterative query, the server replies with its best referral and the asker follows it to the next server. Your device asks recursively; the resolver then asks iteratively.
IntermediateQuick answer1 min read - Why does DNS mostly use UDP, and when does it switch to TCP?
A DNS lookup is one small question and one small answer, so UDP avoids the cost of a handshake. DNS falls back to TCP when the answer is too large for a UDP response (truncated flag set), for zone transfers, and for DNS over TLS.
IntermediateQuick answer1 min read