Reported July 2026
Anthropicsimulation

Repair the Bootloader Program

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

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

The Anthropic OA reported in July 2026 hands you a tiny bootloader with plus, next, and jump, and exactly one instruction has its next/jump op swapped. The detail that matters: the operand is still correct, only the operation flipped. That makes this a simulation problem with a single-change search, not anything fancy. You have a day or two, so know the shape cold. If you blank mid-assessment, StealthCoder runs invisibly on your desktop and gives you a working solution in real time. Better to walk in already knowing the loop-detection plus flip-one-instruction approach.

The problem

Interview report note: The reports described a bootloader program with plus, next, and jump instructions, plus one swapped next/jump instruction that causes a loop. This practice version is an estimated 90% match for the repair task; the original numeric constraints and the separate loop-reporting output were not shared.
A bootloader executes a list of instructions using a program counter pc and an accumulator that starts at 0. Each instruction contains an operation and a signed integer operand.
Instruction semantics
plus x: add x to the accumulator, then advance to the next instruction.
next x: ignore x and advance to the next instruction.
jump x: move the program counter by x.
The program terminates normally when the program counter moves past the final instruction. It is looping if it is about to execute an instruction that it has already executed.
Repair rule
Exactly one instruction was corrupted: a next operation was changed to jump, or a jump operation was changed to next. Its operand is still correct. Changing that one operation back makes the program terminate normally.
Repair the corrupted instruction and return the accumulator value after the repaired program terminates.

Function
repairBootloader(instructions: String[]) → int

Examples
Example 1
instructions = ["plus +1","next +0","jump -1","plus +3"]
return = 4
The original program repeats instructions 1 and 2. Changing instruction 2 from jump -1 to next -1 lets execution reach the final plus +3 instruction and terminate with accumulator 1 + 3 = 4.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is brute force that's still cheap. Write a helper that simulates the program with a visited set and returns whether it terminated plus the accumulator. Then try flipping each next or jump instruction one at a time, run the helper, and return the accumulator from the one run that terminates. That's O(n^2) worst case, and it's fine unless the constraints say otherwise, which the report didn't share. Pitfalls: jump moves the counter by x, so jump +0 is an instant loop. Termination means pc goes past the end, so check pc >= n, and also guard against a negative pc. Parse the signed operand carefully, since "+3" and "-1" both appear. Never flip plus. Don't mutate the original list permanently, restore it after each trial. If you freeze on the parsing or the flip loop, StealthCoder is the hedge during the live OA.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Repair the Bootloader Program 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. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Anthropic reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Repair the Bootloader Program FAQ

What's the trick in Repair the Bootloader Program?+

Simulate with a visited set to detect loops, then flip each next or jump one at a time and re-run. The one flip that terminates gives your answer. Plus instructions are never candidates. It's simulation plus a single-change search, not a clever graph problem.

How hard is this Anthropic OA question really?+

Easy to medium. The logic is short, but the details bite: signed operand parsing, what counts as termination, and restoring the instruction after each trial. If you code the simulator cleanly first, the repair loop is a few lines.

Can I do better than O(n^2)?+

Yes, in theory. You could work backward from the exit to find which instructions can reach termination, then check whether a flip on the looping path lands on one. But the report didn't share constraints, so brute force is the safe default. Mention the optimization only if asked.

What edge cases should I test?+

Test a jump with a negative operand that goes below zero, jump +0, a flip that lands exactly one past the last instruction, and a program where the corrupted instruction is the very first or last one. Also check that the accumulator only changes on plus.

How do I prepare in 48 hours for this?+

Write the loop-detecting simulator from scratch twice, then add the flip-and-retry wrapper. Use the provided example and trace it by hand. Practice parsing strings like "jump -1" with a split. That covers nearly everything this problem asks for.

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

OA at Anthropic?
Invisible during screen share
Get it