Bird
0
0

What is the main purpose of using enum types like VehicleType and SpotType in system design?

easy🧠 Conceptual Q11 of 15
LLD - Design — Parking Lot System
What is the main purpose of using enum types like VehicleType and SpotType in system design?
ATo group related constant values and prevent invalid inputs
BTo store large amounts of data efficiently
CTo perform complex mathematical calculations
DTo create user interface elements dynamically
Step-by-Step Solution
Solution:
  1. Step 1: Understand enum purpose

    Enums group related constant values, making code clearer and safer.
  2. Step 2: Identify benefits in system design

    They prevent invalid values by restricting inputs to predefined options.
  3. Final Answer:

    To group related constant values and prevent invalid inputs -> Option A
  4. Quick Check:

    Enums = group constants + prevent errors [OK]
Quick Trick: Enums group fixed options to avoid mistakes [OK]
Common Mistakes:
MISTAKES
  • Thinking enums store large data
  • Confusing enums with data structures
  • Using enums for UI elements

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes