ICA-style · 4 levels · ~90 min · no AI
Key-value store with expiry
Put, get and delete → prefix scans → time-to-live → backups and point-in-time restore. Four levels; expiry reaches into every later operation.
Build an in-memory key-value store: class Store in src/store.py. Every method takes a timestamp first, an integer that strictly increases from one call to the next. Keys and values are strings (a value may be empty).
| Method | Returns |
|---|---|
put(timestamp, key, value) | stores value under key; returns the value it replaced, or None if the key was absent |
get(timestamp, key) | the value, or None if the key is absent |
delete(timestamp, key) | True after removing the key; False if it was absent |
The public tests of this level are tests/test_level1.py; the judge also runs hidden tests. Pass them all to unlock level 2. Leave the later levels' methods in the class: their briefs come with them.
Sign in to run the tests; passing a level unlocks the next.