xAI·Software Engineer·Online Assessment (OA)
Jul 2026
xAI SWE interview had me building an in-memory database from scratch across four progressive levels, starting with basic CRUD and ending with TTL expiry and backup/restore logic. It was a single coding round and the problem kept stacking requirements on top of itself, which was the whole point.
- Implement basic CRUD operations (set, get, delete) on fields within keyed records in an in-memory database.
- Add scan and scan-by-prefix operations that return all fields (or prefix-matching fields) for a given key, formatted as 'field(value)' and sorted lexicographically.
- Extend the database with timestamped versions of all operations, including a set_at_with_ttl that makes a field expire at timestamp + ttl (half-open interval).
- Implement backup and restore: backup captures a snapshot at a given timestamp (storing remaining TTL for fields), and restore reinstates the latest backup at or before a target time, recalculating expiry relative to the restore timestamp.
“This part was fine.” The rest of the author's notes on Software Engineer interview at xAI, Online Assessment (OA) round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post