Design a Chess Move Validation Model
Accept a player's submitted move only when the piece, occupancy, and check rules of standard chess allow it.
Design an in-memory object model that validates chess moves.
For this exercise, assume a player submits a move and the model accepts it only when the piece, occupancy, and check rules allow it. For this exercise, assume standard chess pieces and turns; ignore chess variants and clocks. For this exercise, assume networking, persistence, and matchmaking are out of scope.
For this exercise, assume a concrete walkthrough starts from the initial position and applies White's legal e2-e4 pawn move, then rejects Black's c8-h3 bishop move because the d7 pawn still blocks its path.
For this exercise, assume a focused follow-up will ask how the existing model decides whether a move leaves that player's king in check.