Add Sliding-Window Get and Put Activity Metrics to a Key-Value Store

Last updated: July 30, 2026

Quick Overview

Design a key-value store that supports sliding-window get and put operations for activity metrics, allowing efficient retrieval and storage of data over a specified time frame.

Databricks
Software Engineering Fundamentals
Software Engineer
Databricks
July 30, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

9

0

73 solved


Design a key-value store that supports sliding-window get and put operations for activity metrics, allowing efficient retrieval and storage of data over a specified time frame.

This question is typically asked during onsite interviews for software engineering roles at Databricks to assess a candidate's ability to design scalable systems and handle time-series data. The interviewer is evaluating the candidate's understanding of data structures, algorithms, and system design principles, particularly in the context of performance and efficiency in data retrieval and storage.

What the Interviewer Expects
  • Explain the requirements for the sliding-window functionality clearly.
  • Provide a high-level design of the key-value store architecture.
  • Discuss the choice of data structures and algorithms used for implementation.
  • Identify potential trade-offs and scaling considerations.
  • Demonstrate an understanding of time complexity and performance metrics.
Key Topics to Cover
Key-Value Store
Sliding Window
Data Structures
System Design
Performance Optimization
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would you handle data expiration in your design?
  • What challenges do you foresee with high concurrency?
  • Can you explain how you would test the performance of your implementation?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

To design a key-value store with sliding-window metrics, we need to define the core requirements:

  1. Get Operation: Retrieve the activity metrics for a specific key within a defined time window. 2...
High-Level Design

The architecture can be broken down into the following components:

  • Data Storage: Use a hash map for key-value pairs where the value is a time-series data structure (e.g., a list or a deque).
  • *...

Submit Your Answer
Markdown supported

Related Questions