LLD Logo
LVL1
Command Pattern

Step 1 of 4 · Define commands and receivers

1

Your task

Define commands and receivers

Give requests a common execute and undo contract.

Create execute and undo on the command abstraction.
Give Light turn-on and turn-off operations.
Give Fan a speed that commands can change and restore.

command.py

Your draft · saved locally

1

Structural feedback only—your code stays in this browser and is not executed.