Reported September 2026
OpenAIhash table

In-Memory Key-Value Store Operations

Reported by candidates from OpenAI's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live OpenAI OA. Under 2s to a working solution.
Founder's read

This OpenAI OA, reported in September 2026, looks like a design question but it's a hash map with a string parser bolted on. You get a list of SET, GET and DELETE operations, and you return outputs in order. If you've written a dictionary loop before, you've done the hard part. The risk is sloppy output formatting, not the algorithm. If you blank on the details during the live assessment, StealthCoder runs invisibly on your desktop and hands you a working solution so one missed format string doesn't sink you.

The problem

Process a finite ordered sequence of operations on an in-memory key-value store. The store starts empty, keys are strings, and values are signed integers.
["SET", key, value] stores or overwrites the integer value under key and produces no output.
["GET", key] produces VALUE: followed by the current integer, or NULL when the key is absent.
["DELETE", key] removes the key when present and produces true if a key was removed or false otherwise.
Return the outputs from GET and DELETE operations in operation order.

Function
runKeyValueStore(operations: String[][]) → String[]

Examples
Example 1
operations = [["SET","a","1"],["GET","a"],["SET","a","-2"],["GET","a"],["DELETE","a"],["GET","a"],["DELETE","a"]]
return = ["VALUE:1","VALUE:-2","true","NULL","false"]
The second SET overwrites a. The first deletion succeeds; afterward a is absent and another deletion returns false.
Example 2
operations = [["GET","missing"],["SET","x","0"],["SET","y","2147483647"],["GET","y"],["DELETE","x"],["GET","x"]]
return = ["NULL","VALUE:2147483647","true","NULL"]
A missing lookup returns NULL. Keys are independent, and deleting x does not change y.
Example 3
operations = [["SET","only","-2147483648"]]
return = []
A sequence containing only SET operations produces no output.

Constraints
1 <= operations.length <= 100000.
Every operation is well formed and has exactly the fields described above.
Keys contain from 1 through 50 printable ASCII characters.
Every SET value is a signed 32-bit integer written in base 10.

Reported by candidates. Source: FastPrep

Pattern and pitfall

What it really reduces to: one hash map from string to integer, one pass over the operations, one output list. SET puts or overwrites. GET checks presence and appends VALUE: plus the number, or NULL. DELETE removes the key and appends true or false based on whether it existed. Every operation is O(1) average, so 100000 operations is trivial. The pitfalls are all formatting. Note that GET on a hit has no space after the colon, so it's VALUE:1, and a miss is plain NULL without the VALUE prefix. SET produces no output, so don't append anything. Don't parse the value into an integer unless you need to. Storing the raw string works and avoids overflow concerns at -2147483648. Also check for key presence, not truthiness, because a stored 0 is valid. StealthCoder is your hedge in the live OA if you freeze on those details.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill In-Memory Key-Value Store Operations cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass OpenAI's OA.

OpenAI reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

In-Memory Key-Value Store Operations FAQ

How hard is the OpenAI key-value store question really?+

Easy on algorithm, easy to lose points on formatting. It's a single hash map and one loop. Most failures come from output strings like VALUE:1 versus NULL, or from appending something on SET. Read the examples twice and match them character for character.

What's the trick to this problem?+

There isn't one beyond the hash map. The trick is discipline: SET outputs nothing, GET outputs VALUE:n or NULL, DELETE outputs true or false. Use the map's contains check, not a truthy check, since a stored value of 0 is legitimate and must return VALUE:0.

Do I need to parse the values as integers?+

Not really. You can store the value string as given and echo it back. Values are valid base-10 signed 32-bit integers, so the string already has the right form. If you do parse, use a type that safely holds -2147483648 and 2147483647.

What's the time and space complexity?+

Time is O(n) for n operations, since each hash map action is O(1) on average. Space is O(k) for the distinct live keys plus the output list. With up to 100000 operations and keys of 50 characters, nothing needs optimizing.

How do I prepare for this in 48 hours?+

Write it once in your main language from scratch, then test against the three examples, especially the delete-then-get-then-delete sequence. Practice a clean loop with a switch on the operation name. Also rehearse similar design-lite questions like adding a counter or a history, since follow-ups may extend it.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with OpenAI.

OA at OpenAI?
Invisible during screen share
Get it