Optiver: Multicore overheat controller simulation
Problem. Simulate a firmware thermal controller for a multicore processor. You get a passive cooling capacity shared by the chip, an active cooling capacity per core, a list of core ids and a list of operations. A set operation changes one core's load in watts. A tick operation recomputes every core's status.
Rules. All loads start at zero. A core with zero load is off. Running cores split the passive capacity equally and each also gets its own active capacity. A running core is fine if its load is at most its total cooling, otherwise it is throttled.
Output. For each tick, return the coreId=status strings for the cores whose status changed since the last tick, sorted by core id. Return an empty list for a tick where nothing changed.
Pitfalls the candidate listed.
- Always emit a result for every tick, even an empty one.
- Skip cores whose status did not change.
- Avoid dividing by zero when no core is running.
- Compare with multiplication instead of floating point.
- A later set for the same core overwrites the earlier one.
The candidate noted the original status names may differ slightly from what they remembered.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.