Overheat Prevention Controller
Reported by candidates from Optiver's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Optiver reportedly sent the Overheat Prevention Controller in September 2026, and the first thing you'll notice is timestamps up to 10^9. You can't tick through every second. That rules out the obvious simulation. It's a time-skipping event simulation over at most 200 cores and 2000 operations, and the coreIds times operations bound of 2*10^5 tells you per-operation work over all cores is fine. If you blank on how to jump between shutdown events, StealthCoder is the safety net that runs invisibly during the live OA.
The problem
You are implementing firmware for a multicore processor. Each core runs a configurable workload that produces heat, every core has its own active-cooling capacity, and all running cores share a pooled-cooling capacity. The operating system changes workloads with SetCoreLoad and calls Tick to learn which cores have changed between running and shut down. Practice Thermal Model For this exercise, use the following deterministic model: At time 0, every core is running with temperature 0 and load 0. Time and all operation timestamps are measured in whole seconds. If r cores are running during a second, each running core receives floor(pooledCooling / r) units of pooled cooling for that second. For a running core i, its temperature changes during that second by load[i] - activeCooling[i] - floor(pooledCooling / r). Temperature cannot fall below 0. If a core's temperature reaches or exceeds shutdownTemperature at the end of a second, it shuts down before the next second. Pooled cooling is redistributed among the remaining running cores. A shut-down core does not heat or cool until it is restarted by SetCoreLoad. Restarting sets its temperature to 0. Operations The arrays operations and operationData describe calls in non-decreasing timestamp order. Operations with the same timestamp are processed in array order. SetCoreLoad has data [timestamp, coreId, watts]. First advance the controller to timestamp, then set that core's load to watts. If the core is shut down, restart it at temperature 0. Tick has data [timestamp]. Advance the controller to timestamp, return the IDs of all cores whose running/shut-down status changed at least once since the previous Tick, sorted in ascending order, then clear the change set. If one core changes status multiple times between two Tick calls, include its ID only once. Return one row for every Tick, in call order. Complete simulateOverheatController with parameters pooledCooling, coreIds, activeCooling, shutdownTemperature, operations, and operationData. Function simulateOverheatController(pooledCooling: int, coreIds: int[], activeCooling: int[], shutdownTemperature: int, operations: String[], operationData: int[][]) → int[][] Examples Example 1 pooledCooling = 4 coreIds = [10,20] activeCooling = [1,1] shutdownTemperature = 10 operations = ["SetCoreLoad","SetCoreLoad","Tick","Tick"] operationData = [[0,10,8],[0,20,4],[2],[3]] return = [[10],[]] While both cores run, each receives floor(4 / 2) = 2 pooled-cooling units. Core 10 heats by 8 - 1 - 2 = 5 per second and reaches temperature 10 at time 2, so the first Tick returns [10]. Core 20 remains running through time 3, so the second Tick returns an empty row. Example 2 pooledCooling = 3 coreIds = [1] activeCooling = [2] shutdownTemperature = 5 operations = ["SetCoreLoad","Tick","SetCoreLoad","Tick","SetCoreLoad","Tick","SetCoreLoad","Tick"] operationData = [[0,1,6],[1],[1,1,0],[3],[3,1,10],[4],[4,1,4],[5]] return = [[],[],[1],[1]] The first two Tick calls observe no status change. After the load becomes 10, the core reaches the shutdown temperature at time 4, so the third row is [1]. The following SetCoreLoad restarts the core at time 4. The final Tick reports that restart as another status change. Constraints 1 <= coreIds.length = activeCooling.length <= 200 All coreIds are distinct. 0 <= pooledCooling, activeCooling[i] <= 10^6 1 <= shutdownTemperature <= 10^9 1 <= operations.length = operationData.length <= 2000 coreIds.length * operations.length <= 2 * 10^5 Every operation is either SetCoreLoad or Tick. Operation timestamps are integers in [0, 10^9] and are non-decreasing. Every SetCoreLoad uses a valid core ID and a load in [0, 10^6]. There is at least one Tick operation.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is to advance from the current time to the target timestamp in jumps, not second by second. Between events, the running set is fixed, so every running core has a constant per-second delta: load - activeCooling - floor(pooled / r). For each running core with positive delta, compute the seconds until it hits shutdownTemperature using ceiling division. Take the minimum across cores, jump that far (or to the target if sooner), update temperatures with clamping at 0, shut down cores that crossed, recompute r, and repeat. Each shutdown shrinks r, so loops are bounded by the core count per advance. Pitfalls: cores with a delta of 0 or less never overheat, but clamp at 0 still matters. Shutting down changes the pooled share for the next second, so you can't batch past it. Track a change set per Tick, deduplicate it, and sort it. Restarts count as changes too, as Example 2 shows.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Overheat Prevention Controller 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 for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Optiver's OA.
Optiver reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Overheat Prevention Controller FAQ
What's the trick in the Optiver Overheat Prevention Controller?+
Skip time instead of simulating each second. Between events the running set is constant, so each core's heating rate is constant. Compute the earliest shutdown with ceiling division, jump there, remove the overheated cores, recompute the pooled share, and repeat until you reach the target timestamp.
Why does brute-force simulation fail here?+
Timestamps go up to 10^9, so stepping one second at a time is far too slow. The constraints are built to punish it. The coreIds times operations cap of 2*10^5 only supports work per operation that scales with cores, not with elapsed seconds.
What edge cases break most solutions?+
Cores with a non-positive delta never overheat and must be skipped when finding the next shutdown. Temperature clamps at 0, which matters when load is below cooling. Several cores can shut down in the same second. A core restarted by SetCoreLoad counts as a status change, and a core that flips twice between Ticks appears once.
Does a SetCoreLoad on a running core reset its temperature?+
No. Only a shut-down core restarts at temperature 0. For a running core, you advance to the timestamp first, then just change the load. The new load applies from that moment onward, and the temperature carries over.
How do I prepare for this in 48 hours?+
Write the event-jump loop once from scratch on Example 1 and Example 2. Check the integer math: floor division for the pooled share and ceiling division for the time to shutdown. Then test the same-timestamp ordering and the dedupe-and-sort of the change set on a few small cases.