PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Determine whether a word exists in a letter grid

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given an `m x n` grid of characters `board` and a string `word`, determine whether `word` can be constructed from sequentially adjacent cells. Rules: - Adjacent cells are those horizontally or vertically neighboring (no diagonals). - The same cell may not be used more than once in a single construction path. #### Input - `board`: 2D array of characters - `word`: target string #### Output - Return `true` if `word` exists in the grid by the rules above, else `false`. #### Example `board = [[A,B,C,E],[S,F,C,S],[A,D,E,E]]`, `word = "ABCCED"` → `true` #### Constraints - `1 ≤ m, n ≤ 12` - `1 ≤ |word| ≤ m*n`

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.

Return whether word can be formed from horizontal/vertical neighboring cells without reusing a cell.

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

  1. Backtrack from every matching start cell.
  2. Mark a cell as used during the current path.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find a secret word using match feedback - Atlassian (hard)
  • Compute a moving average on a stream - Atlassian (hard)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Implement sequential and parallel URL requests - Atlassian (medium)
  • Merge intervals and design rating APIs - Atlassian (medium)