PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Optiver

Design an Event-Driven CPU Overheat Controller

Last updated: Jul 14, 2026

Quick Overview

Design an event-driven controller that advances simulated CPU core temperatures across timestamped load changes and reports deterministic state transitions. Define per-core state, shared and active cooling, atomic event ordering, shutdown and restart behavior, validation, and tests without inventing a heat equation.

  • hard
  • Optiver
  • Software Engineering Fundamentals
  • Software Engineer

Design an Event-Driven CPU Overheat Controller

Company: Optiver

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Take-home Project

# Design an Event-Driven CPU Overheat Controller Design an `OverheatPreventionController` that simulates multiple processor cores without physical sensors. Each core has a power load and temperature. Cooling combines one passive capacity shared across the processor with an active capacity assigned per running core. The controller exposes three operations: - initialization with cooling capacities and stable core IDs; - `set_core_load(timestamp, core_id, watts)`, which schedules or applies a load change and may restart a shut-down core; - `tick(timestamp)`, which advances the simulation and returns the IDs of cores whose externally visible state changed since the previous tick. Explain the state model, time advancement, event ordering, shutdown/restart behavior, and tests. Do not guess a particular heat equation or threshold; identify those as requirements that must be clarified. ### Constraints & Assumptions - Timestamps are monotonic but may have gaps of arbitrary length. - Load changes are processed lazily through time advancement rather than a background thread. - A core can be running or shut down, and its temperature and requested load must be tracked. - The result of `tick` must have deterministic ordering. - All state changes at one timestamp must be handled atomically from the caller's perspective. ### Clarifying Questions to Ask - What exact equation converts load, elapsed time, and cooling into temperature change? - How is shared passive cooling divided among running, idle, or already shut-down cores? - What temperature triggers shutdown, and is there a different restart threshold? - Does `set_core_load` take effect before or after thermal evolution at the same timestamp? - Does calling `set_core_load` immediately restart a core, or merely request a restart at the next tick? - Which fields count as a state change returned by `tick`, and should IDs be sorted or event-ordered? ### What a Strong Answer Covers - Per-core state, controller-wide time, pending events, and last-reported snapshots. - One centralized `advance_to(timestamp)` path used by both public operations. - Piecewise simulation across event timestamps rather than applying all elapsed time at the final load. - Explicit same-timestamp precedence and deterministic changed-ID ordering. - Shutdown, cooling while shut down, requested-load retention, and restart transitions. - Validation of unknown IDs, backward timestamps, duplicate operations, and numeric boundaries. ### Follow-up Questions - Can the next threshold crossing be computed analytically instead of stepping through time? - What if several cores shut down simultaneously and thereby change shared cooling allocation? - How would you make repeated calls at the same timestamp idempotent? - Which invariants would you assert after every transition?

Quick Answer: Design an event-driven controller that advances simulated CPU core temperatures across timestamped load changes and reports deterministic state transitions. Define per-core state, shared and active cooling, atomic event ordering, shutdown and restart behavior, validation, and tests without inventing a heat equation.

Related Interview Questions

  • Optiver Beat The Odds: Five Rapid-Fire Probability Brainteasers (Dice, Cards, Coins, Pigeonhole) - Optiver (medium)
  • Reviewing a Freight-Scheduler Codebase: Bugs, Data Structures, and Concurrency - Optiver (hard)
  • Design an object-oriented queue and compare implementations - Optiver (medium)
  • Prove a Tight Lower Bound on a Latin Square's Lower-Triangle Sum - Optiver (medium)
|Home/Software Engineering Fundamentals/Optiver

Design an Event-Driven CPU Overheat Controller

Optiver logo
Optiver
Jul 2, 2026, 12:00 AM
hardSoftware EngineerTake-home ProjectSoftware Engineering Fundamentals
15
0

Design an Event-Driven CPU Overheat Controller

Design an OverheatPreventionController that simulates multiple processor cores without physical sensors. Each core has a power load and temperature. Cooling combines one passive capacity shared across the processor with an active capacity assigned per running core.

The controller exposes three operations:

  • initialization with cooling capacities and stable core IDs;
  • set_core_load(timestamp, core_id, watts) , which schedules or applies a load change and may restart a shut-down core;
  • tick(timestamp) , which advances the simulation and returns the IDs of cores whose externally visible state changed since the previous tick.

Explain the state model, time advancement, event ordering, shutdown/restart behavior, and tests. Do not guess a particular heat equation or threshold; identify those as requirements that must be clarified.

Constraints & Assumptions

  • Timestamps are monotonic but may have gaps of arbitrary length.
  • Load changes are processed lazily through time advancement rather than a background thread.
  • A core can be running or shut down, and its temperature and requested load must be tracked.
  • The result of tick must have deterministic ordering.
  • All state changes at one timestamp must be handled atomically from the caller's perspective.

Clarifying Questions to Ask

  • What exact equation converts load, elapsed time, and cooling into temperature change?
  • How is shared passive cooling divided among running, idle, or already shut-down cores?
  • What temperature triggers shutdown, and is there a different restart threshold?
  • Does set_core_load take effect before or after thermal evolution at the same timestamp?
  • Does calling set_core_load immediately restart a core, or merely request a restart at the next tick?
  • Which fields count as a state change returned by tick , and should IDs be sorted or event-ordered?

What a Strong Answer Covers

  • Per-core state, controller-wide time, pending events, and last-reported snapshots.
  • One centralized advance_to(timestamp) path used by both public operations.
  • Piecewise simulation across event timestamps rather than applying all elapsed time at the final load.
  • Explicit same-timestamp precedence and deterministic changed-ID ordering.
  • Shutdown, cooling while shut down, requested-load retention, and restart transitions.
  • Validation of unknown IDs, backward timestamps, duplicate operations, and numeric boundaries.

Follow-up Questions

  • Can the next threshold crossing be computed analytically instead of stepping through time?
  • What if several cores shut down simultaneously and thereby change shared cooling allocation?
  • How would you make repeated calls at the same timestamp idempotent?
  • Which invariants would you assert after every transition?
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Optiver•More Software Engineer•Optiver Software Engineer•Optiver Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.