You are required to implement an in-memory cache module/library which you will embed in your application to improve the application performance, by holding heavily accessed (read/written) application

Medium
Company: Premium
GoogleAmazon

Imagine you're building a high-performance service, and you need a blazingly fast, in-memory cache to avoid hitting slower data sources repeatedly. Your task is to design and implement a robust, thread-safe, and extensible in-memory cache library. This isn't just about storing and retrieving data; it's about building a core component that can adapt to various eviction policies, handle concurrent access gracefully, and provide a consistent interface for different data types. The goal is to create a cache that is easy to integrate, maintain, and extend as the needs of the application evolve. Consider the trade-offs between performance, memory usage, and complexity.

Requirements

Interview Simulation

Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.

Interviewer

Let's start by understanding the scope. What are the core functionalities this system needs to provide?

💡 Interview Tip

Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.

Press ⌘ + Enter to submit

Premium Content

View detailed solutions.

UNLOCK PREMIUM