← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

Interviewed for a software engineering role at Akuna Capital and got a system design-flavored coding question about building a small in-memory communication manager. Pretty focused interview, no fluff.

Questions Asked (1)

Q1

Design a simple in-memory communication manager that supports connecting two users, disconnecting two previously connected users, and clearing all connections. Walk through your data structure choices, write the code, and analyze time and space complexity.

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

I went with an adjacency list using a hash map of sets, which felt right for this kind of undirected relationship problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose an adjacency list using a hash map (or dictionary) of sets to store connections, which supports O(1) average-time operations. Write clean, modular code for connect, disconnect, and clear, and analyze time and space complexity for each operation.

Pro tip: Mention that using a set for each user's connections ensures no duplicate connections and makes disconnect O(1) on average; also note that clearing all connections can be O(1) if you simply reassign the main map to a new empty map, but be prepared to discuss the trade-off with garbage collection.

1. Clarify Requirements and Constraints

Ask whether connections are bidirectional, if self-connections are allowed, and if there are any limits on the number of users or connections. Confirm that operations should be as efficient as possible.

2. Choose Data Structures

Propose an adjacency list using a hash map where each key is a user ID and the value is a set of connected user IDs. Explain why a set is better than a list for O(1) average-time add, remove, and lookup.

3. Implement Core Operations

Write code for connect(user1, user2), disconnect(user1, user2), and clearAll(). Ensure connect adds each user to the other's set (if bidirectional), disconnect removes them, and clearAll resets the map.

4. Analyze Complexity

For each operation, state the average and worst-case time complexity and the space complexity. For example, connect and disconnect are O(1) average, clearAll is O(1) if reassigning the map, and space is O(U + C) where U is users and C is connections.

5. Discuss Trade-offs and Extensions

Mention alternative data structures (e.g., adjacency matrix) and their trade-offs, and suggest possible extensions like thread safety or persistence if relevant.

Key Points to Mention

  • Use a hash map (dictionary) with sets for O(1) average-time operations.
  • Connections are typically bidirectional, so connect and disconnect must update both users' sets.
  • clearAll can be O(1) by reassigning the map to a new empty map, but this may have memory implications.
  • Time complexity: connect and disconnect are O(1) average, O(n) worst-case if hash collisions; clearAll is O(1) if reassigning, O(n) if iterating.
  • Space complexity: O(U + C) where U is number of users and C is number of connections.
  • Consider edge cases: connecting already connected users, disconnecting non-connected users, and self-connections.

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