Customer Support Chat Platform
Design a real-time support chat service that uses order context to suggest an issue, routes customers to agents, and preserves reliable conversations through spikes, retries, and handoffs.
Problem statement
For this exercise, assume an authenticated customer opens a support case, uses authorized recent-order context to suggest a likely issue and relevant order, confirms or corrects that suggestion, waits for an eligible agent, and exchanges text messages until the case is handed off or closed.
Issue prediction is advisory: low confidence or unavailable order context falls back to a customer-selected issue or general support queue, and never prevents opening a case. Record the order-context version and predictor version that produced a suggestion; avoid exposing another customer's orders.
Training a prediction model is outside scope. The platform owns the support case, agent assignment, conversation history, and customer-visible status; customer identity and order details come from existing services.
One case has at most one active agent assignment, one agent may handle up to four active cases, and assignment retries must not consume capacity twice. Accepted messages are durable, client retries must not duplicate them, and history is ordered within a case.
A reconnecting customer or agent resumes from a cursor without unexplained gaps. Assume 5 million new cases per day, 100,000 concurrent conversations, and peaks of 50,000 messages per second.
Return durable message acceptance within 300 milliseconds at p95, deliver to a healthy connected peer within one second at p95, and assign 95 percent of cases that have an eligible available agent within five seconds. Retain case and message history for 180 days.
Design the order-context and prediction path, APIs, state model, assignment and queueing path, real-time messaging path, storage, scaling, failure recovery, backpressure, and observability.
Explain compute hosting and autoscaling choices and compare relational and nonrelational storage, including where ACID transactions are required and where eventual consistency is safe.
If evaluating virtual-machine hosting such as EC2, justify it against a managed or container-based alternative rather than assuming a vendor is required. Voice, video, automated answer generation, refunds, order mutation, and workforce scheduling are outside scope.
What to build
- A customer can obtain a likely-issue suggestion from authorized recent orders, confirm or correct it, and idempotently open a support case with the selected issue and optional order; unavailable prediction falls back to manual selection or general support.
- The platform uses the confirmed issue and agent skills to assign a queued case to one eligible agent without exceeding the agent's active-case capacity.
- The customer and active agent exchange durable, case-ordered text messages and resume from a cursor after reconnecting.
- An authorized agent can hand off or close a case while preserving its complete assignment and conversation history.
At scale
- Assume 5 million new support cases per day, 100,000 concurrent conversations, and peaks of 50,000 messages per second.
- Durably accept a message within 300 milliseconds at p95 and deliver it to a healthy connected peer within one second at p95.
- Assign 95 percent of queued cases that have an eligible available agent within five seconds without assigning one case or one capacity slot twice.
- Retain support-case, assignment, and message history for 180 days and keep it queryable by authorized participants.