Design a Read-Once Chat System
GrammarlySoftware Engineer · OnsiteLast updated
This question evaluates a candidate's competence in large-scale system design and distributed messaging, including API and data model design, read-once delivery semantics, consistency trade-offs, and operational concerns like scaling, partitioning, and failure handling.
Design a chat messaging system where one sender can select multiple recipients at send time, but the message is not a group chat message. Instead, the system creates separate recipient-specific deliveries.
Core requirements:
- A sender can send the same message to many recipients at once.
- Each recipient should only be able to view the message one time.
- After a recipient reads the message, that recipient's copy must be deleted or made permanently unavailable.
- One recipient reading a message must not affect another recipient's copy.
- The system should support online delivery, offline recipients, retries, and large-scale traffic.
Please describe:
- APIs
- data model
- high-level architecture
- message fan-out strategy
- read-once enforcement
- deletion and retention behavior
- scaling, load balancing, and partitioning choices
- failure handling and consistency tradeoffs
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.