PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Akuna Capital

Design user communication functions

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of in-memory data structures, undirected relationship modeling, and API design for managing mutable user communication links.

  • easy
  • Akuna Capital
  • System Design
  • Software Engineer

Design user communication functions

Company: Akuna Capital

Role: Software Engineer

Category: System Design

Difficulty: easy

Interview Round: Take-home Project

##### Question Design a simple in-memory communication manager for users. Implement 2–3 functions to ( 1) connect two users so they can communicate, ( 2) disconnect two previously connected users, and ( 3) clear all existing user communications. Describe your data structures, provide code, and analyze time/space complexity.

Quick Answer: This question evaluates a candidate's understanding of in-memory data structures, undirected relationship modeling, and API design for managing mutable user communication links.

Related Interview Questions

  • Implement a two-user communications handler - Akuna Capital (medium)
  • Design communication handler and exceptions - Akuna Capital (medium)
  • Design an order-matching engine - Akuna Capital (hard)
  • Fix and harden an object pool - Akuna Capital (hard)
  • Design user communication manager APIs - Akuna Capital (medium)
Akuna Capital logo
Akuna Capital
Aug 4, 2025, 10:55 AM
Software Engineer
Take-home Project
System Design
3
0

In-Memory Communication Manager

Context

Build a simple in-memory component that tracks which users can communicate with each other. Treat a communication link between two users as an undirected connection (if A can talk to B, then B can talk to A). Assume user IDs are hashable (e.g., strings or integers) and that the system runs in a single process.

Requirements

Implement the following functions:

  1. connect(user_a, user_b): Create a bidirectional connection so the two users can communicate.
  2. disconnect(user_a, user_b): Remove an existing bidirectional connection, if present.
  3. clear(): Remove all existing user communications.

Also:

  • Describe the data structures you use.
  • Provide code for the above API.
  • Analyze the time and space complexity.

Assumptions

  • Connections are undirected and idempotent (calling connect twice for the same pair should not create duplicates or errors).
  • Self-connections (a user connected to itself) should be rejected or ignored.
  • Disconnecting a non-existent connection should be a no-op.
  • Creating a connection for users not yet seen should implicitly add them to the system.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Akuna Capital•More Software Engineer•Akuna Capital Software Engineer•Akuna Capital System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.