Katkat

Design an in-memory key-value store using maps

LinkedInSoftware Engineer · Onsite

Last updated

This question evaluates skills in in-memory data modeling, concurrent access control, time-complexity reasoning for expected O(1) operations, and storage engine considerations such as durability, compaction, and TTL when restricting indexing to map/dictionary primitives.

Design a low-level key-value store library (like an embedded storage engine) under an interview constraint: you may use only map/dictionary-like data structures (plus primitive types / arrays if needed) for your in-memory indexing.

Core API

  • put(key, value)
  • get(key) -> value | null
  • delete(key)

Required properties

  • Expected O(1) average time for get/put/delete
  • Safe under concurrent access (multiple threads)
  • Optional but good to discuss: durability (crash recovery), compaction, TTL/expiration

Deliverable

Explain your design choices (data model, concurrency strategy, persistence approach if any), and how you would test it.