Design in-memory database API
OpenAISoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's ability to design and reason about in-memory data storage, indexing, query planning, and the underlying data structures and algorithms for insert and query operations.
Question
Design and implement an in-memory database that supports:
insert(table, record)
query(table, columns_to_project, conditions=[(column, operator, value)], order_by=(columns, ascending))
Extend the design to explain how indexes would be built and used for faster WHERE and ORDER BY queries.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.