LLD - Design — Chess GameIn a board game design, which class should contain the logic for valid moves of a piece?AThe base Piece class onlyBA separate unrelated utility classCThe Board class onlyDEach specific piece subclassCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify responsibility of move logicEach piece type has unique movement rules, so logic must be specific to piece subclasses.Step 2: Why not base or board class?The base class is generic; the board manages positions but not piece-specific moves.Final Answer:Each specific piece subclass -> Option DQuick Check:Move logic location = Piece subclass [OK]Quick Trick: Specific moves belong to each piece type class [OK]Common Mistakes:Putting all move logic in base classAssigning move logic to board classUsing unrelated utility classes for moves
Master "Design — Chess Game" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Advanced LLD Concepts - Dependency injection framework - Quiz 4medium Design — Chess Game - Piece movement rules (polymorphism) - Quiz 5medium Design — Food Delivery System - Delivery agent assignment - Quiz 14medium Design — Food Delivery System - Rating and review system - Quiz 8hard Design — Hotel Booking System - Search and filter design - Quiz 5medium Design — Hotel Booking System - Why booking tests availability and concurrency - Quiz 4medium Design — Online Shopping Cart - Pricing strategy (discounts, coupons) - Quiz 8hard Design — Online Shopping Cart - Payment strategy pattern - Quiz 3easy Design — Online Shopping Cart - Product, Cart, Order classes - Quiz 13medium Design — Splitwise (Expense Sharing) - Simplify debts algorithm - Quiz 10hard