OpenAI

Verified interview challenge

Build a durable key-value store

Make a key-value store survive a fresh object instance, then adapt it to small persisted files.

Unlock with Full Access

The challenge

Make a key-value store recover its contents when a fresh object is created. Keys and values can contain arbitrary Unicode and control characters, and the exercise supplies byte-conversion helpers and a mock filesystem instead of a ready-made object serializer.

After the first part passes, adapt the persistence design to a small per-file size limit. You must preserve the meaning of the stored data as its physical representation changes.

What you'll practise

  • Unambiguous encoding

    Preserve keys and values containing arbitrary Unicode and control characters.

  • Bounded persistence

    Adapt the representation so the whole store remains recoverable within file limits.

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.