Welcome to the platform team. The in-memory database in database/ already handles records and scans (levels 1 and 2), and its tests pass. The session service now needs values that disappear on their own. The two new meth…
Welcome to the platform team. The in-memory database in database/ already handles records and scans (levels 1 and 2), and its tests pass. The session service now needs values that disappear on their own. The two new methods are stubbed in database/database.py, and the rules for level 3 are in README.md.
Build level 3 in 35 minutes. The checks are graded one by one, so each part you get working counts even if the rest is not done.
set_with_ttl(timestamp, key, field, value, ttl) stores a value that is visible until just before timestamp + ttl, and gone at timestamp + ttl.get returns None, compare_and_set and compare_and_delete return False, and scan and scan_by_prefix leave it out.compare_and_set_with_ttl replaces a matching, unexpired value and gives the new value its own expiry.set and compare_and_set still write values that never expire, even over a value that had a TTL.pytest tests/visible. tests/visible/test_level3.py fails until level 3 works.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
in-memory-database-values-that-expire
Changes under src/ are evaluated.