← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Coding screen for a software engineering role at Akuna Capital. The problem was an OOP design question around a two-user communication handler, which sounds straightforward until you actually start thinking through all the edge cases they want you to handle explicitly.

Questions Asked (1)

Q1

Implement a two-user communications handler. You need to write a CommsHandler class with connect, hangup, and clear_all methods, plus a custom CommunicationException. The handler should only allow one active pair at a time, raise exceptions when users try to connect with themselves or when the line is busy, and return specific formatted strings on success or disconnection.

API & IntegrationsSystem DesignTechnical Trade-offs
Author's notes

The class structure itself wasn't the hard part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases, then design a class with a single active connection state and a custom exception hierarchy. Implement the methods to enforce the constraints, ensuring clear error messages and formatted return strings. Test with scenarios like self-connect, busy line, and proper hangup.

Pro tip: Demonstrate defensive programming by validating inputs early and using a state machine to manage the connection lifecycle, which shows you think about maintainability and edge cases beyond the happy path.

1. Clarify Requirements

Ask questions to confirm the expected behavior, such as the exact format of return strings, whether connect should return a string or raise an exception on success, and if there are any concurrency concerns.

2. Design the Class and Exception

Define CommunicationException as a subclass of Exception, and outline the CommsHandler class with attributes to track the active connection (e.g., a tuple of user IDs or None).

3. Implement Core Methods

Write connect to check for self-connect and busy line, raising CommunicationException with appropriate messages; on success, store the pair and return the formatted string. Implement hangup to clear the connection and return a disconnection string, and clear_all to reset state.

4. Handle Edge Cases and Testing

Consider scenarios like hanging up when no connection exists, connecting after a hangup, and multiple clear_all calls. Write unit tests to verify all paths.

5. Discuss Trade-offs and Extensions

Mention potential improvements like thread safety, supporting multiple pairs, or using a more sophisticated state pattern, showing awareness of design trade-offs.

Key Points to Mention

  • Custom exception hierarchy and meaningful error messages
  • State management for a single active connection (e.g., using None or a tuple)
  • Input validation for self-connect and busy line scenarios
  • Exact return string formatting as specified
  • Idempotency of hangup and clear_all methods
  • Potential concurrency issues and thread safety considerations

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