Bird
0
0

Given the following state transitions:

medium📝 Analysis Q4 of 15
LLD - Design — Elevator System
Given the following state transitions:
idle --(moveUp)--> moving_up
moving_up --(stop)--> idle
idle --(moveDown)--> moving_down
moving_down --(stop)--> idle

What is the final state after the sequence of events: moveUp, stop, moveDown?
Amoving_down
Bidle
Cmoving_up
Derror
Step-by-Step Solution
Solution:
  1. Step 1: Trace events step-by-step

    Start at idle. moveUp moves to moving_up. stop moves back to idle. moveDown moves to moving_down.
  2. Step 2: Identify final state

    After all events, the system is in moving_down state.
  3. Final Answer:

    moving_down -> Option A
  4. Quick Check:

    Event sequence leads to moving_down [OK]
Quick Trick: Follow events stepwise to find final state [OK]
Common Mistakes:
MISTAKES
  • Stopping too early
  • Confusing moveUp and moveDown
  • Assuming error state incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes