← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Atlassian software engineering interview with two meaty coding problems back to back. Both leaned heavy on data structures and design, less about grinding leetcode patterns and more about thinking through tradeoffs out loud.

Questions Asked (2)

Q1

Design and implement a grid-based snake game with a clean API. The snake starts at the top-left corner moving right. Food items are consumed in order, and eating one grows the snake. Each step call returns the current score or -1 on collision. The solution should run in O(1) time per step.

Algorithms & Data StructuresSystem Design
Author's notes

This one took me a minute to even figure out what data structure to use.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the API and constraints, then design the data structures to achieve O(1) per step. Use a deque for the snake body and a hash set for occupied cells, and precompute the food positions. Implement the step logic with careful collision detection and score updates.

Pro tip: Mention that you can use a circular buffer or a doubly linked list with a hash map for O(1) operations, and discuss trade-offs between memory and speed. Also, handle edge cases like self-collision and out-of-bounds gracefully.

1. Clarify requirements and API

Ask about grid size, food placement, scoring rules, and what constitutes a collision. Confirm the expected return values and any constraints on memory or time.

2. Design data structures

Choose a deque for the snake body to allow O(1) addition/removal at both ends, and a hash set for O(1) membership checks. Precompute food positions in a queue.

3. Implement step logic

Compute the new head position, check for collisions with walls or the snake's body (excluding the tail if it will move), then update the snake and score accordingly.

4. Handle food consumption and growth

If the new head is on a food item, increase the score and do not remove the tail; otherwise, remove the tail to maintain length. Update the food queue.

5. Test and optimize

Write unit tests for edge cases like immediate collision, eating food, and long snakes. Verify O(1) time per step and discuss potential optimizations.

Key Points to Mention

  • Use a deque (double-ended queue) for the snake body to achieve O(1) append and popleft operations.
  • Maintain a hash set of occupied cells for O(1) collision detection with the snake's body.
  • Precompute food positions in a queue and consume them in order.
  • When moving, check if the new head collides with the body, but ignore the tail if it will move (unless food is eaten).
  • Return -1 on collision and the current score otherwise.
  • Discuss time and space complexity: O(1) per step, O(n) space for the snake.

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

Q2

Given an n-ary tree representing an org chart (only child pointers, no parent pointers), find the lowest common manager of two employees. Handle cases where either employee might not exist in the tree. Discuss both a single-query approach and a preprocessing approach for many queries.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Classic LCA but with the no-parent-pointer constraint and the missing-node wrinkle.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: confirm the tree is n-ary with only child pointers, and that we need to handle missing employees. For a single query, use a recursive post-order traversal that returns whether each employee is found and the LCA when both are found. For many queries, discuss preprocessing with Euler tour + RMQ or binary lifting to answer LCA in O(1) or O(log n) time, noting the trade-off of O(n log n) preprocessing.

Pro tip: Mention that in an org chart, the LCA is the lowest common manager, and if one employee is an ancestor of the other, the ancestor is the manager. Also, handle missing employees by returning null and clearly stating the assumption about whether both must exist.

1. Clarify requirements and edge cases

Confirm the tree structure, whether employees are guaranteed to exist, and if the tree is static or dynamic. Discuss what to return if one or both employees are missing.

2. Single-query approach

Explain a recursive DFS that returns a status (found A, found B, or LCA) from each subtree. At each node, combine results from children to determine if the current node is the LCA.

3. Preprocessing for many queries

Describe how to preprocess the tree for efficient LCA queries, such as Euler tour + sparse table for O(1) queries, or binary lifting for O(log n) queries. Mention the preprocessing time and space.

4. Compare trade-offs

Discuss when to use each approach: single-query is simpler and uses O(n) time and O(h) space; preprocessing is better for many queries but requires O(n log n) time and space.

5. Handle missing employees

Explain how to detect missing employees during traversal or preprocessing, and how to adjust the algorithm to return null or an appropriate error.

Key Points to Mention

  • Definition of LCA in a tree and its application to org charts (lowest common manager).
  • Recursive post-order traversal for single query, returning a tuple (foundA, foundB, lca).
  • Euler tour technique to convert tree to array, then RMQ with sparse table for O(1) LCA queries.
  • Binary lifting (jump pointers) for O(log n) LCA queries with O(n log n) preprocessing.
  • Handling missing employees: check existence during traversal or preprocessing, and return null if either is missing.
  • Time and space complexity analysis for both approaches, and trade-offs for many queries.

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