Largest Microorganism After Consumption
Reported by candidates from OpenAI's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The OpenAI OA reported in October 2026 looks like a creature-feature story, but it's a simulation problem wearing a costume. Microorganisms sit in a line, each with a family and a size, and they eat smaller neighbors in rounds. The catch is the round rules: who participated, who's adjacent after earlier removals, and who gets to act first. If you blank on the bookkeeping, StealthCoder runs invisibly as a safety net during the live assessment. Read the rules slowly first, because the code is short once the rules are pinned down.
The problem
Microorganisms are arranged from left to right. Microorganism i has family families[i] and positive size sizes[i]. The simulation proceeds in rounds. At the start of each round, every surviving microorganism is eligible to participate once. Scan the current line from left to right: If the current microorganism and its immediate left neighbor have not participated this round, and the left neighbor is strictly smaller, the current microorganism eats the left neighbor. Otherwise, if the current microorganism and its immediate right neighbor have not participated this round, and the right neighbor is strictly smaller, the current microorganism eats the right neighbor. Otherwise, it does nothing. When one microorganism eats another, the eater gains the target's size, the target disappears, and the eater cannot participate again in that round. Earlier removals immediately change which microorganisms are adjacent. Examples Example 1 families = ["A","B","C"] sizes = [3,1,2] return = "A 6" In the first round, A eats B and grows to 4. In the next round, A eats C and grows to 6.
Reported by candidates. Source: FastPrep
Pattern and pitfall
What it really reduces to: simulate rounds exactly as written. Keep the line as a list, plus a per-round participated flag for each element. Scan left to right. For the current element, check the left neighbor first. If neither has participated and the left is strictly smaller, eat it, add its size, mark the eater as used, and remove the target immediately. Otherwise try the right neighbor with the same checks. Repeat rounds until a full round has no eats. The pitfall is index drift after deletion. Use a linked list or rebuild the line carefully, and don't process a removed element. Also note the left neighbor's flag matters, so a creature that just ate can't be eaten again that round by the rule as stated. The example output format, family then size, hints at returning the largest survivor. If you freeze on the pointer handling, StealthCoder is the hedge during the live OA.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Largest Microorganism After Consumption 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. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass OpenAI's OA.
OpenAI reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Largest Microorganism After Consumption FAQ
What's the trick in the Largest Microorganism After Consumption problem?+
There's no clever algorithm. It's careful simulation. Track a participated flag per creature, scan left to right, try left neighbor first, then right, and apply removals immediately so adjacency updates mid-scan. Loop rounds until nothing changes.
How hard is this OpenAI OA question really?+
Logic-wise it's easy to medium. The difficulty is translating wordy rules into code without off-by-one errors after deletions. Candidates usually lose time on ordering and the participation flags, not on any data structure.
Should I use an array or a linked list?+
A doubly linked list makes immediate removal and neighbor lookup clean. A plain array with rebuilds per round works too if you handle indices carefully. With small inputs either passes, but the linked list avoids index drift bugs.
When does the simulation stop?+
Stop when a full round produces no eating. Every eat removes one creature, so the number of rounds is bounded by the line length. After that, pick the largest remaining creature and return its family and size.
How do I prepare for this in 48 hours?+
Practice writing a simulation with a linked list and per-round flags. Walk through the given example by hand, then invent a case with ties and a chain of eats. Check that equal sizes never eat, since the rule says strictly smaller.