Design an in-memory key-value store using maps

Quick Overview

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 an in-memory key-value store using maps

Company: LinkedIn

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

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.

Overview: 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.

|Home/System Design/LinkedIn
LinkedIn logo
LinkedIn
Nov 21, 2025
mediumSoftware EngineerOnsiteSystem Design
21
0

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.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...