Challenge - 5 Problems
Elevator State Machine Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is state machine modeling crucial in elevator design?
Elevators must handle multiple states like moving up, moving down, door open, and door closed. Why is using a state machine model important for designing such systems?
Attempts:
2 left
💡 Hint
Think about how elevators must respond to different events and ensure safety.
✗ Incorrect
State machines provide a clear way to represent all elevator states and how the system moves between them, which is essential for safety and correctness.
❓ Architecture
intermediate2:00remaining
Which component in elevator design acts like a state machine?
In an elevator system, which component best represents a state machine controlling the elevator's behavior?
Attempts:
2 left
💡 Hint
Consider which part decides what the elevator does next based on current conditions.
✗ Incorrect
The controller module tracks the elevator's current state and decides transitions like opening doors or moving floors.
❓ scaling
advanced2:30remaining
How does state machine complexity grow with multiple elevators?
When designing a building with multiple elevators, how does the complexity of the state machine controlling the system change?
Attempts:
2 left
💡 Hint
Think about how elevators must work together to serve requests efficiently.
✗ Incorrect
Multiple elevators require coordination, increasing the number of states and transitions to handle combined behaviors.
❓ tradeoff
advanced2:30remaining
Tradeoff between simple and complex state machines in elevator design
What is a key tradeoff when choosing between a simple state machine and a complex state machine for elevator control?
Attempts:
2 left
💡 Hint
Consider maintainability versus coverage of scenarios.
✗ Incorrect
Simple state machines are easier but might miss rare cases; complex ones cover more but increase design difficulty.
❓ estimation
expert3:00remaining
Estimate the number of states in a 10-floor elevator state machine
Estimate how many states a state machine controlling a single elevator with 10 floors might have, considering states like moving up, moving down, door open, door closed, and idle at each floor.
Attempts:
2 left
💡 Hint
Think about combining floor positions with door and movement states.
✗ Incorrect
Each floor can have multiple states (idle, moving up/down, door open/closed), so total states multiply accordingly.
