Bird
0
0

Consider a move validation function that checks if a move is allowed only if the target cell is empty. Given the board state where cell 3 is occupied, what will validateMove(3) return?

medium📝 Analysis Q5 of 15
LLD - Design — Tic-Tac-Toe Game
Consider a move validation function that checks if a move is allowed only if the target cell is empty. Given the board state where cell 3 is occupied, what will validateMove(3) return?
ANull
BFalse
CError
DTrue
Step-by-Step Solution
Solution:
  1. Step 1: Understand the validation rule

    Move is valid only if target cell is empty.
  2. Step 2: Check cell 3 status

    Cell 3 is occupied, so move is invalid.
  3. Final Answer:

    False -> Option B
  4. Quick Check:

    Occupied cell move = False [OK]
Quick Trick: Occupied cell means invalid move [OK]
Common Mistakes:
MISTAKES
  • Assuming occupied cells are allowed
  • Returning True by mistake
  • Confusing error with invalid move

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes