Bird
0
0

Why is it important to separate the responsibilities of Board, Player, and Game classes in a board game design?

hard🧠 Conceptual Q10 of 15
LLD - Design — Tic-Tac-Toe Game
Why is it important to separate the responsibilities of Board, Player, and Game classes in a board game design?
ATo improve code maintainability and scalability by following single responsibility principle
BTo reduce the number of classes and simplify the design
CTo ensure all game logic is in one place for easier debugging
DTo allow Player class to control the entire game flow
Step-by-Step Solution
Solution:
  1. Step 1: Understand single responsibility principle

    Each class should have one clear responsibility to keep code clean and scalable.
  2. Step 2: Evaluate other options

    Reducing classes oversimplifies design; putting all logic in one place reduces modularity; Player controlling flow breaks separation.
  3. Final Answer:

    Separation improves maintainability and scalability -> Option A
  4. Quick Check:

    Single responsibility principle = separation [OK]
Quick Trick: Separate concerns for clean, scalable design [OK]
Common Mistakes:
MISTAKES
  • Merging responsibilities
  • Centralizing all logic in one class

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes