Bird
0
0

What is the main purpose of using a Room type hierarchy in system design?

easy📝 Conceptual Q11 of 15
LLD - Design — Hotel Booking System
What is the main purpose of using a Room type hierarchy in system design?
ATo randomly assign room types without any structure
BTo organize rooms by shared and unique features for easier maintenance
CTo store all room data in a single flat list without categories
DTo duplicate room properties in every class separately
Step-by-Step Solution
Solution:
  1. Step 1: Understand the concept of hierarchy

    A hierarchy groups items by common traits, making management simpler.
  2. Step 2: Apply to room types

    Using a base class for shared features and subclasses for specifics avoids duplication and eases updates.
  3. Final Answer:

    To organize rooms by shared and unique features for easier maintenance -> Option B
  4. Quick Check:

    Hierarchy = Organize by features [OK]
Quick Trick: Think: shared features go in base, unique in subclasses [OK]
Common Mistakes:
  • Confusing hierarchy with flat lists
  • Duplicating properties in every room class
  • Ignoring shared features in base class

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes