PracHub
QuestionsPremiumLearningGuidesInterview PrepCoaches
|Home/Software Engineering Fundamentals/Databricks

Build a Durable Key-Value Cache

Last updated: May 31, 2026

Quick Overview

This question evaluates a candidate's competency in designing durable in-memory key-value caches, covering concepts such as write-ahead logging, crash recovery, log compaction, handling partial writes, deletion semantics, and concurrency control.

  • medium
  • Databricks
  • Software Engineering Fundamentals
  • Software Engineer

Build a Durable Key-Value Cache

Company: Databricks

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Design and implement an in-memory key-value cache that uses a write-ahead log for durability. The cache should support at least the following operations: ```text put(key, value) get(key) delete(key) ``` Requirements: 1. Recent values should be served from memory with low latency. 2. Every mutation must be appended to a write-ahead log before it is considered successful. 3. If the process crashes and restarts, the cache should rebuild its in-memory state by replaying the log. 4. Deletions must remain durable after restart. 5. Discuss how to handle log growth, compaction, partial writes, and concurrency.

Quick Answer: This question evaluates a candidate's competency in designing durable in-memory key-value caches, covering concepts such as write-ahead logging, crash recovery, log compaction, handling partial writes, deletion semantics, and concurrency control.

Related Interview Questions

  • Design a Cache with Hit Counts - Databricks (hard)
  • Design a multi-threaded synchronous log writer - Databricks (hard)
  • Optimize least-k revenue queries for read/write load - Databricks (medium)
  • Design a multithreaded event logger - Databricks (medium)
  • Explain storing files to disk with concurrency - Databricks (medium)
Databricks logo
Databricks
May 14, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
17
0

Design and implement an in-memory key-value cache that uses a write-ahead log for durability.

The cache should support at least the following operations:

put(key, value)
get(key)
delete(key)

Requirements:

  1. Recent values should be served from memory with low latency.
  2. Every mutation must be appended to a write-ahead log before it is considered successful.
  3. If the process crashes and restarts, the cache should rebuild its in-memory state by replaying the log.
  4. Deletions must remain durable after restart.
  5. Discuss how to handle log growth, compaction, partial writes, and concurrency.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Databricks•More Software Engineer•Databricks Software Engineer•Databricks Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.