Design in-memory (Questions like write to add,remove the table,etc).

Medium
Company: Premium
GoogleAmazon

Let's design an in-memory data structure that mimics the functionality of a simplified relational database table. This 'Table' will hold records consisting of columns and rows. We need to support basic CRUD (Create, Read, Update, Delete) operations. The challenge lies in designing a flexible, efficient, and thread-safe data structure. We want the 'Table' to be generic enough to handle different data types for the columns. Imagine you're building the core of a lightweight analytical tool, and this in-memory table is the foundation. The beauty of this problem is in the tradeoffs made when deciding which indexing strategies to use, how to handle concurrency, and designing for future extensibility as new data types and query capabilities are introduced.

This is more than just using a HashMap<String, Object>! We need to think about schema management, data validation, and efficient retrieval of information. The 'Table' needs to be robust enough to handle a moderate number of concurrent read and write operations.

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