xAI

Verified interview challenge

Build a database with expiry and restore

Keep a record store consistent as fields gain expiry times and the database gains backup and restore.

Unlock with Full Access

The challenge

An in-memory record store grows from basic field operations into ordered scans, expiry, backup and restore. Your class carries forward across four levels.

The later features make time part of the data model. A value can exist in a saved record yet no longer be live, so the implementation must preserve the specified meaning of records and their lifetime as state is queried and restored.

What you'll practise

  • Expiry semantics

    Determine which fields are visible at the time of an operation.

  • Snapshot restoration

    Preserve the required state and lifetime behaviour when restoring a backup.

Your coding workspacePreview
Current partFurther parts unlock as you progress
solution.pyPython 3.13
# Build on your implementation

# Run checks for the current part

# Full starter code included
Current-part checks

Run your code to see results.

The complete sequence, starter code and checks are included with Full Access.