← Valon Interview Insights

Valon·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Valon SWE interview had me building a mini in-memory database from scratch, which I wasn't expecting to be as tricky as it turned out. The dynamic schema part especially caught me thinking harder than I'd like to admit.

Questions Asked (1)

Q1

Design and implement an in-memory SQL-like database that supports INSERT and SELECT operations, where each table's schema grows dynamically based on what columns have been inserted, and missing columns are treated as NULL.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

The core structure wasn't too bad once I landed on a map from table name to a list of row maps.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design a simple yet extensible data model using a dictionary of tables, where each table stores rows as dictionaries mapping column names to values. Implement INSERT to dynamically add new columns to the table's schema and fill missing values with NULL, and SELECT to filter and project rows, treating absent columns as NULL. Discuss trade-offs and potential optimizations.

Pro tip: Demonstrate awareness of schema evolution challenges by mentioning how you'd handle column ordering, type consistency, and efficient NULL representation, and suggest that a column-oriented store could be more efficient for sparse data.

1. Clarify Requirements and Constraints

Ask about expected operations, data volume, concurrency needs, and whether schema changes should be persisted. Confirm that missing columns are NULL and that schema grows dynamically.

2. Design Data Structures

Propose a Table class with a set of column names and a list of rows, where each row is a map from column name to value. Alternatively, use a list of values with a column index mapping.

3. Implement INSERT

For each new row, add any unseen columns to the table's schema, then store the row with provided values and NULL for missing columns. Ensure existing rows are backfilled with NULL for new columns.

4. Implement SELECT

Parse the SELECT query to determine target columns and optional WHERE conditions. Iterate over rows, evaluate conditions (treating missing columns as NULL), and project the requested columns, returning NULL for missing ones.

5. Discuss Optimizations and Trade-offs

Mention indexing for faster lookups, columnar storage for sparse data, and handling of data types. Discuss time/space complexity and potential improvements.

Key Points to Mention

  • Dynamic schema evolution: adding columns on the fly and backfilling existing rows with NULL.
  • Efficient representation of NULLs, e.g., using a sentinel value or a separate presence bitmap.
  • Query processing: parsing simple SELECT statements, filtering with WHERE, and projecting columns.
  • Data structure choices: row-oriented vs. column-oriented storage and their impact on performance.
  • Handling of data types and potential type coercion when new columns are added.
  • Concurrency and persistence considerations if the database needs to support multiple users or survive restarts.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.