Katkat

Design an In-Memory Database

ValonSoftware Engineer · Technical Screen

Last updated

This question evaluates a candidate's skills in data modeling, in-memory data structures, index design, and query/filter semantics for a flexible schema-less record store.

Implement a simple in-memory database with a flexible, schema-less record model.

Requirements:

  • Each record is a mapping from column_name to value.
  • The schema is not fixed: different records may contain different columns.
  • A record may omit some columns entirely.
  • Support inserting new records.
  • Support querying by column name. At minimum, the system should be able to return the records that contain a given column, along with the stored value for that column.
  • After implementing the core logic, create a few representative test cases yourself to demonstrate correctness.

Follow-up:

  • Extend the query interface to support filtering, such as returning records that satisfy conditions on one or more columns.
  • Because records may have missing fields, define and handle the behavior when a filter references a column that is absent in some records.

You may choose the exact API and internal data structures, but the design should make the operations above efficient and easy to test.