Retell·Software Engineer·Onsite - System Design / Architecture
Jun 2026
Retell SWE interview that was basically 'build a mini SQL engine from scratch.' Three parts: architecture, core implementation, then keep extending it as the interviewer piles on features. More open-ended than I expected, less about grinding leetcode and more about whether you can scope a real system under pressure.
- Design and implement a small in-memory SQL query engine that takes a SQL string and executes it against in-memory tables. Start with a basic subset and be ready to extend as features get added.
- Before writing any code, walk through the architecture of the query engine. What are the components, what does each consume and produce, and where do future features like JOIN or GROUP BY plug in?
- Implement the core engine: parse and execute SELECT with a WHERE clause supporting comparison operators and AND/OR logic.
- Extend the engine to support ORDER BY and LIMIT, aggregate functions with GROUP BY, and an INNER JOIN between two tables.
- How would you support joining three or more tables, and how does join order affect performance?
- How would you add HAVING and subqueries to your AST and executor?
- Where would a query optimizer fit in your design, and what is one rewrite that would help performance?
- How would you test this engine to stay confident it's correct as you keep adding features?
“The scoping part is what tripped me up at first.”