Bird
0
0

Which of the following correctly represents a state transition in an elevator state machine?

easy🧠 Conceptual Q12 of 15
LLD - Design — Elevator System
Which of the following correctly represents a state transition in an elevator state machine?
A<code>Idle -> Door Open -> Moving Up</code>
B<code>Idle -> Moving Up -> Door Open</code>
C<code>Door Open -> Moving Down -> Door Closed</code>
D<code>Moving Up -> Door Closed -> Idle</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify valid elevator state order

    An elevator usually goes from Idle to Moving Up, then Door Open when it reaches the floor.
  2. Step 2: Check each option's sequence

    Idle -> Moving Up -> Door Open correctly shows Idle -> Moving Up -> Door Open, a valid transition sequence.
  3. Final Answer:

    <code>Idle -> Moving Up -> Door Open</code> -> Option B
  4. Quick Check:

    Idle to Moving Up to Door Open = valid transition [OK]
Quick Trick: Elevator moves before doors open [OK]
Common Mistakes:
MISTAKES
  • Opening doors before moving
  • Closing doors while idle
  • Skipping moving state

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes