Anthropic

Verified interview challenge

Build a DNS resolver with a TTL cache

Extend a resolver from direct records to alias chains, failures and time-limited cached answers.

Unlock with Full Access

The challenge

Build a resolver against a supplied record provider, starting with direct answers and extending it to alias chains, failures and cached responses. The provider simulates the network, so you can concentrate on resolution behaviour.

An alias may require several lookups before an answer is found, while a cached result has a limited lifetime. Extend the same resolver without losing the distinction between a valid answer, a missing name and a lookup error.

What you'll practise

  • Alias traversal

    Follow the lookup chain while preserving the meaning of errors and responses.

  • Time-aware caching

    Reuse results only while the applicable cached information remains valid.

Your coding workspacePreview
Current partFurther parts unlock as you progress
solution.pyPython 3.13
# Build on your implementation

# Run checks for the current part

# Full starter code included
Current-part checks

Run your code to see results.

The complete sequence, starter code and checks are included with Full Access.