Preparing your design workspace

Loading the problem and your saved attempt…

Design a Dimmer and Connected Bulbs System

Model and implement a dimmer, connected bulbs, brightness propagation, validation, and extensible power curves.

For this exercise, assume one dimmer controls a changing set of connected bulbs. Brightness is bounded from 0 through 100, and every bulb has a rated wattage plus a provided brightness-to-power table or curve.

Support connecting and disconnecting bulbs, setting and reading brightness, propagating a valid setting to every connected bulb, and querying each bulb's current power draw.

Decide which objects own the committed brightness, conversion behavior, connection state, and interaction with a real bulb so new bulb and conversion implementations remain easy to add.

Treat an invalid brightness, duplicate connection, unknown disconnection, and an individual bulb that cannot apply an update as explicit outcomes. A newly connected bulb synchronizes to the current dimmer level.

After completing the design, implement the bounded in-memory core behind those interfaces and add deterministic tests. Hardware integration, persistence, and total-power optimization are outside scope.