Bird
0
0

Why does chess serve as a good example to test polymorphism and strategy in system design?

hard📝 Conceptual Q10 of 15
LLD - Design — Chess Game
Why does chess serve as a good example to test polymorphism and strategy in system design?
ABecause each piece requires unique behavior but shares a common interface
BBecause all pieces move identically, simplifying design
CBecause chess does not require any design patterns
DBecause pieces do not interact with each other
Step-by-Step Solution
Solution:
  1. Step 1: Analyze chess piece behaviors

    Each piece has unique move rules but must fit into a unified system.
  2. Step 2: Connect to polymorphism and strategy

    This need for unique yet uniform behavior makes chess ideal to demonstrate polymorphism and strategy patterns.
  3. Final Answer:

    Because each piece requires unique behavior but shares a common interface -> Option A
  4. Quick Check:

    Unique behavior + common interface = chess test [OK]
Quick Trick: Unique behaviors with shared interface = polymorphism test [OK]
Common Mistakes:
  • Assuming all pieces move the same
  • Ignoring design pattern relevance
  • Thinking chess pieces do not interact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes