OpenAI Interview Questions
The coding and system-design questions asked in OpenAI interviews - with worked solutions, in-browser code execution, and active-recall review. 20 questions.
How OpenAI interviews software engineers
OpenAI's loop runs roughly five phases: recruiter screen, a technical screen or take-home, and a final onsite panel, with a hiring-committee review at the end. Most candidates move from first call to decision in about three to four weeks.
The technical screen often uses a progressive 'gate' format - one problem that gets harder in stages, where you typically need to clear at least two gates to advance. Take-homes ask you to build something real (a webhook delivery system is a commonly reported example) and grade reliability, testing, and code quality over feature count.
The interview loop
- 1Recruiter screen30-45 min on background, motivation, and your understanding of the mission; non-technical.
- 2Technical screen~60 min coding or architecture session, often a single problem in a progressive 'gate' format that escalates in difficulty.
- 3Take-homeA practical project (often ~48 hours) - build a real, working service; graded on reliability, code quality, and tests.
- 4Onsite loop4-6 hours over 1-2 days with 4-6 interviewers: a coding round, system design, a project presentation, and a behavioral session.
What they look for
- Production-minded code: reliability, testing, and clarity over clever one-liners
- Handling escalating difficulty calmly in the gated screen
- Mission understanding and pragmatic engineering judgment
How to prepare
- For the gated screen, get a correct baseline working fast, then optimize - you need to clear multiple gates.
- Treat the take-home like real production code: tests, error handling, a clear README.
- Be ready to present and defend a past project end to end.
Sources
- interviewing.io - OpenAI interview questions & process - Process breakdown and sample questions.
- IGotAnOffer - OpenAI interview process & timeline - Six-step pipeline with timeline.
- Exponent - Get a job at OpenAI - Stage overview and top questions.
See every company's references on the interview-process sources page.
Practice questions
- In-Memory Key-Value Store(premium)
Build a key-value store as a single class. Layer on prefix-scan, TTL, then gzip persistence - each phase is its own surface area on top of the previous one.
Practicalmedium60m2mo - KV Store - Serialize and Deserialize(premium)
The most-reported OpenAI coding problem. An in-memory key-value store where both keys and values are arbitrary strings - delimiters, newlines, unicode, anything. The on-the-wire format must round-trip them all.
Practicalmedium45m2mo - Time-Based Key-Value Store(premium)
A key-value store with timestamped writes. Read at time t returns the latest value written at or before t; later phases add arbitrary-order inserts and range queries.
Practicalmedium35m2mo+9
- Authentication Manager - TTL(premium)
LeetCode 1797. Tokens issued with a fixed TTL; renew before expiry to extend; count live tokens at time t. Later phases push the count to amortized O(1) and add thread safety.
Practicalmedium30m2mo - Meeting Rooms(premium)
Given a list of half-open meeting intervals, find the minimum number of conference rooms; later phases assign specific room IDs and add capped capacity with priority eviction.
Practicalmedium35m2mo+9
- Monster Team Battle(premium)
Auto-simulate a turn-based team fight enforcing round order, dying-strike counterattacks, draw detection, and a full time-ordered event log.
Practicalmedium35m2mo - Disease Spread in a Grid(premium)
A cell becomes infected on step t+1 only if it has at least K infected neighbors right now. Looks like rotting oranges but the K threshold turns it into a wave simulation with stall detection.
Practicalmedium40m2mo - IPv4 Address Iterator and CIDR(premium)
Convert dotted-quad to 32-bit integers and back, iterate forward and reverse over a range, parse CIDR notation, and decompose an arbitrary range into the minimum CIDR cover.
Practicalmedium40m2mo - Async N-ary Cluster Count(premium)
Count nodes in an n-ary tree using async fan-out. The recursion is trivial; the real test is fanning out child queries concurrently so wall-clock time scales with tree depth, not node count.
Practicalmedium30m2mo - Resumable Iterator(premium)
An iterator whose state can be captured and replayed - stop iterating, save the state, hand it to a fresh iterator, and continue from exactly where you left off. Layer composition over flat and nested data.
Practicalmedium40m2mo - Spreadsheet with Formulas(premium)
Cells hold literals or formulas that reference other cells. set_cell evaluates and caches each cell so get_cell is O(1); later levels propagate changes to dependents and reject updates that would form a cycle.
Practicalhard50m2mo - Unix cd with Symlink Resolution(premium)
A stateful shell that supports POSIX cd semantics - absolute and relative paths, `.`/`..`, symlink resolution, and cycle detection. Looks simple, hides a stack-and-recursion problem.
Practicalmedium45m2mo - GPU Credit Tracker: Variant 1(premium)
Two shapes that often combine in the same interview. Historical-balance lookup (add/deduct stamped at a time, query balance as of t) and FIFO consumption with per-batch expiration.
Practicalmedium45m2mo - GPU Credit Tracker: Variant 2(premium)
Single-account GPU credit grants with time windows; FIFO partial spending and windowed balance queries.
Practicalmedium40m2mo - Follow Graph with Snapshots(premium)
A mutable social graph that has to do three hard things at once - answer point-in-time history without copying the world on every snapshot, and rank friends-of-friends recommendations both live and as-of a past snapshot.
Practicalhard60m1mo - In-Memory Database with SQL-like Operations(premium)
A single-table in-memory database supporting INSERT and SELECT with WHERE (AND-only equality) and multi-column ORDER BY. The stable-sort trick is the trade tool.
Practicalmedium40m2mo - Authentication Manager - Sessions(premium)
Session-based auth with register, login, logout, session TTL, and salted password hashing. Paired with the TTL token variant in OpenAI loops.
Practicalmedium35m2mo - KV Store - Chunked Persistence(premium)
The chunked-persistence follow-up to KV Store Serialize/Deserialize. Serialize a key-value store with a fixed-width binary (TLV) format, then split the blob into 1 KB chunks and checkpoint it to an S3-style object store - with the chunk count carried in a chunk header, no separate metadata object.
Practicalhard50m2mo - KV Store - Thread-Safe(premium)
The concurrency follow-up to the in-memory key-value store. Many threads call put / get / erase on one shared store at once; make it correct under contention, then refine from a single global lock to a reader-writer lock and finally to atomic compound operations (get_and_set, compare_and_swap).
Practicalmedium40m1mo - KV Store - Persistent(premium)
The durability follow-up to the in-memory key-value store. Snapshot the store to disk and restore it, then make the write crash-safe with an atomic temp-file rename, then add an append-only write-ahead log so writes made since the last snapshot survive a crash. Length-prefix encoding keeps arbitrary key/value bytes intact across disk.
Practicalmedium40m1mo