← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Atlassian software engineer interview with a coding problem centered on a recommendation engine built from rating data. The question had a deceptively simple setup but the complexity discussion and edge cases made it a real workout.

Questions Asked (1)

Q1

You have a list of (user, movie, rating) tuples. Write a function recommend(user) that returns movies the user hasn't seen, where at least one other user who shares a commonly-rated movie with the target user has rated that candidate movie 4 or 5. Also discuss time/space complexity in terms of users U, movies M, and ratings R, and how you'd handle deduplication or ordering of results.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

I started by building lookup maps: one from user to their rated movies, another from movie to all users who rated it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem and edge cases, then outline a two-phase algorithm: first build a user-to-movies mapping and identify similar users who share at least one commonly-rated movie with the target user; second, collect candidate movies rated 4 or 5 by those similar users, excluding movies the target user has already seen. Finally, analyze time and space complexity in terms of U, M, and R, and discuss deduplication and ordering strategies.

Pro tip: Mention that you would use a set for deduplication and a heap or sorting for ordering by relevance (e.g., number of similar users who rated the movie highly), and note that the choice depends on whether you need top-N recommendations or all candidates.

1. Clarify requirements and edge cases

Ask about the size of the dataset, whether ratings are on a 1-5 scale, if there are missing values, and whether the function should return all candidates or top-N. Also clarify if 'commonly-rated movie' means any movie rated by both users, regardless of rating value.

2. Design data structures and algorithm

Build a mapping from user to set of movies they've rated, and optionally a mapping from movie to set of users who rated it. Identify similar users by intersecting the target user's rated movies with each other user's rated movies. Then, for each similar user, collect movies they rated 4 or 5 that the target user hasn't seen.

3. Handle deduplication and ordering

Use a set to deduplicate candidate movies. For ordering, consider sorting by the number of similar users who rated the movie 4 or 5, or by average rating among similar users. If only top-N are needed, use a min-heap of size N for efficiency.

4. Analyze time and space complexity

Time: Building user-movie mapping takes O(R). Finding similar users takes O(U * min(R/U, M)) in the worst case, but can be optimized by iterating over movies the target user rated and collecting co-raters. Collecting candidates takes O(S * avg_movies_per_user), where S is the number of similar users. Space: O(R) for the mapping, plus O(M) for the candidate set.

5. Discuss trade-offs and optimizations

Mention that the naive approach may be inefficient for large U and R; suggest optimizations like precomputing user similarities, using inverted indices, or limiting similar users to top-K by similarity. Also discuss whether to include movies with few ratings or apply a threshold.

Key Points to Mention

  • Use a set for deduplication of candidate movies.
  • Order results by relevance, e.g., number of similar users who rated the movie 4 or 5, or average rating.
  • Time complexity: O(R + U * avg_movies_per_user) in the worst case, but can be optimized to O(R + S * avg_movies_per_user) by only considering co-raters.
  • Space complexity: O(R) for storing user-movie mappings and O(M) for candidate set.
  • Edge cases: user with no ratings, no similar users, or no candidate movies.
  • Optimization: use a min-heap for top-N recommendations to avoid sorting all candidates.

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