LLD - Design — Chess GameWhich of the following conditions must be true for castling to be allowed in a chess game?AThe king is currently in check and moves two squares towards the rook.BNeither the king nor the rook involved has moved before, and no pieces are between them.CThe rook has moved once, but the king has not moved.DThe king moves diagonally two squares towards the rook.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand castling rulesCastling requires that neither the king nor the rook involved has moved before, and the squares between them are empty.Step 2: Check king safety conditionsThe king cannot be in check, nor can it pass through or land on a square under attack during castling.Final Answer:Neither the king nor the rook involved has moved before, and no pieces are between them. -> Option BQuick Check:Castling conditions = Neither the king nor the rook involved has moved before, and no pieces are between them. [OK]Quick Trick: Castling needs unmoved king and rook with clear path [OK]Common Mistakes:Allowing castling when king is in checkIgnoring if rook has movedAllowing king to move diagonally during castling
Master "Design — Chess Game" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Advanced LLD Concepts - Why advanced concepts handle production systems - Quiz 1easy Advanced LLD Concepts - Code review checklist for LLD - Quiz 1easy Design — Chess Game - Board and piece hierarchy - Quiz 5medium Design — Chess Game - Move validation and check detection - Quiz 6medium Design — Chess Game - Move validation and check detection - Quiz 11easy Design — Food Delivery System - Order tracking state machine - Quiz 15hard Design — Hotel Booking System - Cancellation and refund policy - Quiz 8hard Design — Hotel Booking System - Availability checking - Quiz 9hard Design — Online Shopping Cart - Why e-commerce tests real-world complexity - Quiz 1easy Design — Splitwise (Expense Sharing) - Simplify debts algorithm - Quiz 3easy