Skip to main content
medium

In-Memory SQL Engine

Also known as: In-Memory SQL Engine (Custom)

In-Memory SQL Engine You're building a tiny in-memory SQL system (no real database). All values are strings, and each table has a fixed column order. Implement class SQL with these methods: - createTable(tableName, columns): Create OR REPLACE a table (drop existing rows). - insertRow(tableName, values): Insert a row where values[i] corresponds to columns[i]. - deleteRows(tableName, whereColumn, whereValue): Delete ALL rows matching the filter. - selectRows(tableName, columns, whereColumn, whereValue): Return matching rows, projecting only the requested columns, in insertion order. run_sql_script below executes a list of commands against your SQL instance.

You're implementing CREATE, INSERT, SELECT, and DELETE from scratch—no shortcuts. Interviewers love it because it exposes whether you can follow a spec precisely without drifting. The trap is getting lost in state management halfway through. Keep your table representation explicit and the rest follows.

DesignSimulation

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Table Builder Warmupeasy
2Part 2
3Part 3

Each locked part opens in the editor once the part before it passes.