Determine whether a word exists in a letter grid
Company: Atlassian
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates algorithmic problem-solving and implementation skills in grid-based search, including concepts like graph traversal and backtracking; it falls under Coding & Algorithms and primarily assesses practical application and state-management implementation rather than only conceptual understanding.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], "ABCCED")
Expected Output: True
Explanation: The word exists by adjacent cells.
Input: ([["A","B"],["C","D"]], "ABCD")
Expected Output: False
Explanation: Cells cannot be reused and moves cannot be diagonal.
Input: ([["a"]], "a")
Expected Output: True
Explanation: Single-cell word works.
Hints
- Backtrack from every matching start cell.
- Mark a cell as used during the current path.