← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Atlassian software engineer interview with a grid-based word search problem. Pretty standard algorithmic round but the complexity discussion was where things got interesting.

Questions Asked (1)

Q1

Given an m x n character grid and a target word, can the word be found by moving through horizontally or vertically adjacent cells without reusing any cell? Walk through your approach and analyze the time and space complexity.

Algorithms & Data Structures
Author's notes

DFS with backtracking was the obvious move here and I got there pretty quickly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use depth-first search (DFS) with backtracking from each cell that matches the first character of the word. At each step, explore all four adjacent cells, mark the current cell as visited to avoid reuse, and backtrack when needed. Analyze time complexity as O(m * n * 4^L) where L is the word length, and space complexity as O(L) for recursion stack.

Pro tip: Mention that you can optimize by checking character frequency counts upfront: if the word contains more of a character than the grid, return false immediately. Also, start DFS from the cell with the fewest matching neighbors to reduce search space.

1. Clarify and Validate

Confirm grid dimensions, word length, and edge cases (empty grid, empty word, single cell). Check if word length exceeds total cells; if so, return false.

2. Choose Algorithm

Select DFS with backtracking as the primary approach. Explain why BFS is less suitable due to path tracking complexity.

3. Implement DFS with Backtracking

Iterate over each cell; if it matches word[0], start DFS. In DFS, mark cell as visited (e.g., temporarily change its value), recurse on neighbors for next character, then restore the cell.

4. Analyze Complexity

Time: O(m * n * 4^L) worst-case, where L is word length. Space: O(L) for recursion stack, plus O(1) if modifying grid in-place.

5. Discuss Optimizations

Mention pruning techniques: frequency check, early termination, and direction ordering based on grid boundaries.

Key Points to Mention

  • Backtracking to avoid reusing cells (mark and unmark).
  • Time complexity: O(m * n * 4^L) with explanation of branching factor.
  • Space complexity: O(L) recursion depth, and in-place modification avoids extra space.
  • Edge cases: empty word, word longer than grid cells, single character word.
  • Optimization: character frequency pre-check to fail fast.
  • Alternative: iterative DFS with explicit stack, but recursion is cleaner.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.