The Runtime Theory
mediumNetworkInternals#explain-the-model#reason-about-tradeoffs

Explain DNS Resolution Is a Chain of Cached Questions

Explain the model, execution steps, complexity, and limits of dns resolution is a chain of cached questions.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team6 min read

Interview prompt

Explain dns resolution is a chain of cached questions to an engineer who understands the surrounding system but has not used this technique. Walk from its contract to a concrete operation, then discuss where it fails or becomes expensive.

A strong answer

DNS maps names to typed records through a distributed hierarchy. A stub resolver usually asks a recursive resolver to find an answer. That resolver may consult caches, follow referrals from root to top-level and authoritative servers, and return records with a time-to-live.

For a hostname, the answer can involve a CNAME alias followed by address records. The recursive resolver caches each record within its TTL, so two clients can observe different answers during a change. Negative answers can also be cached, affecting how quickly a newly created name becomes visible.

A complete answer also calls out the assumptions that control correctness. DNS is not a single global database lookup and a resolver’s cache may be stale until expiration. Multiple A or AAAA records do not guarantee that every client uses them as intended. DNSSEC can authenticate signed DNS data, but it does not encrypt ordinary DNS queries or secure the application protocol.

Close by describing one representative test or measurement. A service moves to a new address but some users keep reaching the old one. Trace which caches may be involved and explain why lowering TTL immediately before a change may not help clients that cached an earlier TTL.

Follow-up questions

Answer the follow-ups in the frontmatter. Use the linked article for the concept and the trace to make the explanation concrete.

This answer walks

Practice follow-ups

  1. 01Which assumption is essential for the approach to be correct?
  2. 02What is the worst case, and how does it change the resource cost?
  3. 03How would you adapt the design if the input or workload became much larger?
  4. 04What boundary test would give you the most confidence in the implementation?

One dispatch a week

The trace behind each question, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save