← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Atlassian software engineer interview with a system design coding question focused on building an in-memory voting module. Pretty clean problem scope but the follow-up behavior questions tripped me up a bit.

Questions Asked (1)

Q1

Design an in-memory module where agents can rate items (like tickets or articles) with a 1-5 integer score. It should support computing average ratings per item and returning all items sorted by average rating descending, with ties broken by item ID ascending. Also handle edge cases: what if an agent votes on the same item twice, and what do you return for items with no votes?

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

I jumped straight to hashmaps which was fine, but I fumbled the duplicate vote handling for longer than I should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a data structure that maps item IDs to their ratings and supports efficient updates and sorting. Discuss how to handle duplicate votes (e.g., overwrite or reject) and items with no votes (e.g., exclude or assign default). Finally, outline the algorithm for computing averages and sorting with tie-breaking.

Pro tip: Mention that you would confirm the expected behavior for duplicate votes and no-vote items with the interviewer, as these are ambiguous and could impact the design. This shows attention to detail and collaborative problem-solving.

1. Clarify Requirements

Ask about expected scale, whether votes can be updated, and how to handle edge cases like duplicate votes and no-vote items. Confirm the output format for sorted items.

2. Design Data Structures

Propose a map from item ID to a list or map of agent ratings, or a map to aggregate data (sum, count) for efficiency. Consider memory vs. speed trade-offs.

3. Handle Edge Cases

Decide on duplicate vote behavior: either overwrite the previous rating or reject the new one. For items with no votes, either exclude them from the sorted list or include with a default average (e.g., 0).

4. Compute Averages and Sort

Calculate average per item by summing ratings and dividing by count. Sort items by average descending, then by item ID ascending for ties. Use a comparator or sort with a custom key.

5. Analyze Complexity and Optimize

Discuss time and space complexity. For frequent queries, consider maintaining a sorted structure or caching results. Mention potential concurrency issues if applicable.

Key Points to Mention

  • Choice of data structure: hash map for O(1) average access, with nested maps or lists for ratings.
  • Duplicate vote handling: overwrite vs. reject, and implications on average calculation.
  • No-vote items: exclude from sorted list or assign a default average (e.g., 0), and justify choice.
  • Sorting algorithm: use a comparator that sorts by average descending and item ID ascending.
  • Time complexity: O(n log n) for sorting, where n is number of items; O(1) for updates if using aggregate data.
  • Space complexity: O(m) where m is total number of votes, or O(n) if storing aggregates only.

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