~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
DNS resolver
Recursive CNAME resolution, cycle detection, TTL cache.
Main path: 3 problems, about 2 hours.
Notes
Recognise it when: following CNAME-style indirections: aliases, redirects, symlinks.
- Walk the chain with a
seenset. Raise on a revisit (a cycle) or a missing record. - Resolving everything: memoize, and when a chain ends, write the result (or the failure) back onto every name on the chain, so the total work is O(n).
- Real DNS extras: case-insensitive names, TTL caches (store
expires_at, check it on read), and coalescing concurrent lookups for the same name.
3 problems
Practical systems
Files & networks Deduplicating files, resolving names.
DNS resolver guide
- Follow a CNAME chain with loop detection basics py · c++ · java easy
- Exact and wildcard records, most specific wins py · c++ · java easy
- DNS resolution with CNAME cycles assessment 5 levels Anthropic py · c++ · java hard