Design user communication manager APIs
Company: Akuna Capital
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Take-home Project
Design a lightweight in-memory communication manager between users. Implement 2–3 functions: connect(userA, userB) to establish a bidirectional session, disconnect(userA, userB) to terminate it, and clear(userA, userB) to remove session state/history without leaving users connected. Specify method signatures, data structures (e.g., hash maps, adjacency sets), expected time/space complexities, edge cases (duplicate connects, missing sessions), and how you would handle concurrency or invalid inputs. Include a brief testing plan.
Quick Answer: Design user communication manager APIs evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.