← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Atlassian software engineer round with a graph/connection tracking problem. Pretty straightforward premise but the implementation details are where things get interesting.

Questions Asked (1)

Q1

You're given a stream of bidirectional connection and disconnection events between users. After processing the full stream, return two groups: users with fewer than N connections, and users with N or more connections. Only include users who appeared in at least one event.

Algorithms & Data StructuresSystem Design
Author's notes

My first instinct was to just count connections as a number per user, which works until you realize disconnects can happen and you need to avoid double-counting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a hash map to track each user's current connection count, incrementing on connect and decrementing on disconnect. After processing all events, iterate through the map and partition users into two groups based on whether their count is less than N or at least N. Ensure only users who appeared in at least one event are included.

Pro tip: Clarify edge cases upfront, such as duplicate disconnections or self-connections, and discuss how you'd handle them to show attention to detail. Also, mention that the order of events matters and that you assume the stream is valid (e.g., no disconnection without a prior connection).

1. Clarify requirements and edge cases

Ask about the definition of a connection (e.g., bidirectional means both users are connected), what happens with duplicate events, and whether N is inclusive. Confirm that only users appearing in events should be included.

2. Choose data structures

Use a hash map (dictionary) to map each user ID to their current connection count. This allows O(1) updates per event and efficient iteration at the end.

3. Process the event stream

Iterate through each event: for a connection, increment the count for both users; for a disconnection, decrement the count for both users. If a user is not in the map, initialize their count to 0 before updating.

4. Partition users into groups

After processing all events, iterate through the map and add each user to either the 'fewer than N' group or the 'N or more' group based on their final count.

5. Analyze complexity and discuss optimizations

State that time complexity is O(E) for E events and space is O(U) for U unique users. Mention that this is optimal for a single pass, and discuss potential streaming or distributed approaches if the data is too large.

Key Points to Mention

  • Use of hash map for O(1) updates and efficient lookup
  • Handling of bidirectional connections: update both users per event
  • Edge cases: duplicate disconnections, self-connections, invalid streams
  • Time and space complexity analysis
  • Inclusion of only users who appeared in at least one event
  • Potential for streaming or distributed processing for large-scale systems

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