Katkat

Design Internal Chat and Re-engagement Emails

StubHubSoftware Engineer · Onsite

Last updated

This question evaluates a candidate's competency in designing scalable, real-time messaging systems and re-engagement workflows, covering distributed systems concepts such as WebSocket-based bidirectional communication, presence, cross-server message routing, message persistence, APIs, storage trade-offs, inactivity detection, and email-triggering workflows. Commonly asked in the System Design category, it tests high-level architectural reasoning and practical application of scalability, reliability, and failure-handling trade-offs when integrating persistent WebSocket connections, cross-server routing, and background email jobs in a distributed platform.

Design an internal chat system for an event marketplace company.

Requirements:

  • Employees can send and receive one-to-one messages in real time.
  • Clients use persistent WebSocket connections.
  • A user may connect to any chat server, so sender and recipient may be connected to different servers.
  • Messages should be delivered immediately to online users and stored for later retrieval if a user is offline.
  • Support presence information and basic conversation history.
  • Explain how bidirectional WebSocket communication is routed across multiple servers.
  • In the same overall platform, add a workflow that sends an email to customers who have not logged in for 10 days.

Discuss the high-level architecture, APIs, storage choices, message routing, inactivity detection, scaling, reliability, and failure handling.