Durable Key-Value Store Serialization

Asked at OpenAI · Coding Questions · Difficulty: Medium · Last asked Oct 13, 2026

Implement a persistent key-value store that can serialize and deserialize data to/from a file system. The challenge is designing a **custom binary encoding format — without JSON or pickle** — that correctly round-trips keys and values containing arbitrary characters (newlines, emojis, NUL bytes, commas). A follow-up extends it to a chunked multi-file layout where each file is capped at 1 KB.

Loading the problem…