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

Stateful stores

In-memory database

CRUD with fields, range scans, TTL expiry, time-travel reads.

Notes

Format: CodeSignal-style, 4 levels in about 90 minutes. Each level adds methods, and later tests use earlier ones.

Strategy

  • Read all of level 1, code it plainly, and pass it fast. Speed on the early levels buys time for level 4.
  • Plan for level 4 from the start: storing a history per field (a list of (time, value, expires_at)) makes TTL and "value at time t" trivial.
  • One _value_at(key, field, t) helper that everything calls keeps expiry logic in one place.

Gotchas: is expiry exclusive (t >= expires_at means gone)? Does a plain set clear the TTL? Do scans sort by field name?

5 problems

Practical systems

Stateful stores Key-value stores, file systems, banks, with history.

esc