← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Akuna Capital software engineer interview that was basically one coding design problem: build a connection manager with custom exceptions. Pretty focused session, felt more like a mini systems exercise than a typical coding screen.

Questions Asked (1)

Q1

Design and implement a CommsHandler class that manages one-to-one connections between users, along with a custom ConnectionException. The class needs connect(userA, userB), hangup(user), and clear_all() methods, with proper error handling for invalid states like duplicate connections or self-connections.

System DesignAlgorithms & Data StructuresAPI & Integrations
Author's notes

The hash map approach came to me pretty fast, user pointing to their partner.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then design the data structures and API contracts before coding. Implement the CommsHandler with a hash map for O(1) lookups, define ConnectionException with clear error messages, and write unit tests to validate all scenarios.

Pro tip: Mention that you would use a bidirectional mapping (e.g., two hash maps or a map of sets) to ensure O(1) operations and easy cleanup, and discuss how you'd extend it to support multiple connections per user if needed.

1. Clarify Requirements and Edge Cases

Ask questions to confirm expected behavior: Can a user have multiple connections? What happens if connect is called with an already connected user? Should hangup remove all connections for a user? Define the exact error conditions.

2. Design Data Structures and API

Choose a data structure that allows O(1) connect, hangup, and clear_all. For one-to-one, a hash map from user to their connected partner works; for multiple, use a map of sets. Define method signatures and ConnectionException.

3. Implement ConnectionException

Create a custom exception class that extends Exception (or RuntimeException) with constructors that accept a message and optionally a cause. Ensure it's serializable and provides clear error messages.

4. Implement CommsHandler Methods

Write connect(userA, userB) to validate inputs (non-null, not self, not already connected), update the data structure, and throw ConnectionException on invalid states. Implement hangup(user) to remove the user's connection and update the partner's state. Implement clear_all() to reset the data structure.

5. Test and Discuss Extensions

Write unit tests covering normal flow, duplicate connections, self-connections, hanging up non-connected users, and clear_all. Discuss potential extensions like thread safety, persistence, or scaling to multiple connections.

Key Points to Mention

  • Use of appropriate data structures (e.g., HashMap) for O(1) average time complexity on connect, hangup, and clear_all.
  • Proper validation: check for null users, self-connection, and duplicate connections before modifying state.
  • Custom exception design: ConnectionException should extend Exception or RuntimeException, include meaningful messages, and be thrown consistently.
  • Bidirectional consistency: when connecting or disconnecting, update both users' states to avoid stale references.
  • Thread safety considerations: mention synchronization or concurrent data structures if the handler might be used in a multi-threaded environment.
  • Testing strategy: cover edge cases like connecting an already connected user, hanging up a user with no connection, and clearing all connections.

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