~/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.

Files & networks

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 seen set. 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.

esc