~/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.
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
- Basics: follow a CNAME chain with loop detection basics easy
- Exact and wildcard records, most specific wins easy
- DNS resolution with CNAME cycles 5 levels Anthropic hard