PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Anthropic

Design a One-to-One Chat System

Last updated: Aug 5, 2026

Quick Overview

Design durable one-to-one messaging with ordered history, offline recovery, multi-device delivery, and optional receipt state. Important concerns include idempotent sends, authorization, partitioning, backpressure, reconnect synchronization, retention, and honest failure semantics.

  • medium
  • Anthropic
  • System Design
  • Software Engineer

Design a One-to-One Chat System

Company: Anthropic

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

## Design a One-to-One Chat System The source identifies a one-to-one chat system as the design topic without specifying scale or product behavior. For this practice version, design durable direct messaging between two accounts, including multi-device delivery, offline recovery, conversation history, and optional delivery and read state. Group chat, presence, attachments, and end-to-end encryption must be clarified rather than assumed. ### Part 1 — Define the Messaging Contract Specify conversation, participant, message, client operation, device, and receipt records plus APIs for opening a conversation, sending messages, reading history, and acknowledging progress. #### What This Part Should Cover - One stable conversation identity for the authorized pair under the chosen product rule. - Caller-scoped idempotency for sends and immutable message identity. - Explicit message ordering, edit, deletion, retention, and pagination semantics. - Authorization checks that do not trust participant IDs supplied by a client. ```hint Separate retry identity from message order A client operation ID prevents a duplicate send, while a server-assigned position determines where the accepted message belongs. ``` ### Part 2 — Deliver Online and Recover Offline Design the path from an accepted write to connected recipient devices, push notifications where applicable, reconnect synchronization, and delivery or read acknowledgements. #### What This Part Should Cover - Durable acceptance before an acknowledgement claims the message was sent. - At-least-once transport with client deduplication by message identity. - Per-device synchronization cursors and gap recovery from durable history. - A distinction among accepted, delivered to a device, and read by the account. ```hint Reconnect from a durable position An open socket is a delivery optimization, not the source of truth for messages missed while a device was offline. ``` ### Part 3 — Partition and Handle Failure Choose authoritative storage and partitioning, then address concurrent sends, service retries, connection churn, slow consumers, and a user signed in on several devices. #### What This Part Should Cover - One ordering owner or conditional sequence allocation per conversation. - A transactional outbox or equivalent durable handoff from storage to delivery. - Backpressure and bounded connection or delivery queues. - Recovery from an accepted write whose client acknowledgement was lost. ```hint Keep one ordering boundary Independent writers cannot promise one conversation order unless they coordinate through shared state or one owner. ``` ### Part 4 — Protect and Operate the Service Cover participant privacy, blocking and abuse controls, encryption boundaries, retention or deletion, reconciliation, and observable service health. #### What This Part Should Cover - Authentication and membership checks on send, history, and receipt operations. - Encryption in transit and at rest, with end-to-end encryption treated as a separate product contract. - Repair of delivery events, device cursors, and conversation indexes from authoritative messages. - Metrics for acceptance, duplicate retries, delivery delay, reconnect gaps, queue pressure, and authorization failures. ```hint Measure each promise separately Write durability, online delivery, offline synchronization, and read state fail at different boundaries and should not share one success metric. ``` ### What a Strong Answer Covers - Defines idempotent send, durable acceptance, ordering, and pagination precisely. - Treats sockets and notifications as delivery paths over authoritative message history. - Supports offline and multi-device clients without claiming exactly-once transport. - Includes authorization, bounded queues, repair, retention, and clear state semantics. ### Follow-up Questions 1. How would both participants sending concurrently receive one deterministic conversation order? 2. What should the sender see when the write committed but its response was lost? 3. How would a newly linked device obtain history without exposing another account's conversation? 4. Which design choices change if end-to-end encryption becomes mandatory?

Quick Answer: Design durable one-to-one messaging with ordered history, offline recovery, multi-device delivery, and optional receipt state. Important concerns include idempotent sends, authorization, partitioning, backpressure, reconnect synchronization, retention, and honest failure semantics.

Related Interview Questions

  • Design Peer-to-Peer Model Distribution Under a Shared Link Cap - Anthropic (medium)
  • Design a Resilient Chat System - Anthropic (medium)
  • Deploy a Large Model to GPU Workers - Anthropic (hard)
  • Find a Distributed Mode Efficiently - Anthropic (hard)
  • Design a Dynamically Batched Inference API - Anthropic (hard)
|Home/System Design/Anthropic

Design a One-to-One Chat System

Anthropic logo
Anthropic
May 9, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSystem Design
0
0

Design a One-to-One Chat System

The source identifies a one-to-one chat system as the design topic without specifying scale or product behavior. For this practice version, design durable direct messaging between two accounts, including multi-device delivery, offline recovery, conversation history, and optional delivery and read state. Group chat, presence, attachments, and end-to-end encryption must be clarified rather than assumed.

Part 1 — Define the Messaging Contract

Specify conversation, participant, message, client operation, device, and receipt records plus APIs for opening a conversation, sending messages, reading history, and acknowledging progress.

What This Part Should Cover Guidance

  • One stable conversation identity for the authorized pair under the chosen product rule.
  • Caller-scoped idempotency for sends and immutable message identity.
  • Explicit message ordering, edit, deletion, retention, and pagination semantics.
  • Authorization checks that do not trust participant IDs supplied by a client.

Part 2 — Deliver Online and Recover Offline

Design the path from an accepted write to connected recipient devices, push notifications where applicable, reconnect synchronization, and delivery or read acknowledgements.

What This Part Should Cover Guidance

  • Durable acceptance before an acknowledgement claims the message was sent.
  • At-least-once transport with client deduplication by message identity.
  • Per-device synchronization cursors and gap recovery from durable history.
  • A distinction among accepted, delivered to a device, and read by the account.

Part 3 — Partition and Handle Failure

Choose authoritative storage and partitioning, then address concurrent sends, service retries, connection churn, slow consumers, and a user signed in on several devices.

What This Part Should Cover Guidance

  • One ordering owner or conditional sequence allocation per conversation.
  • A transactional outbox or equivalent durable handoff from storage to delivery.
  • Backpressure and bounded connection or delivery queues.
  • Recovery from an accepted write whose client acknowledgement was lost.

Part 4 — Protect and Operate the Service

Cover participant privacy, blocking and abuse controls, encryption boundaries, retention or deletion, reconciliation, and observable service health.

What This Part Should Cover Guidance

  • Authentication and membership checks on send, history, and receipt operations.
  • Encryption in transit and at rest, with end-to-end encryption treated as a separate product contract.
  • Repair of delivery events, device cursors, and conversation indexes from authoritative messages.
  • Metrics for acceptance, duplicate retries, delivery delay, reconnect gaps, queue pressure, and authorization failures.

What a Strong Answer Covers Guidance

  • Defines idempotent send, durable acceptance, ordering, and pagination precisely.
  • Treats sockets and notifications as delivery paths over authoritative message history.
  • Supports offline and multi-device clients without claiming exactly-once transport.
  • Includes authorization, bounded queues, repair, retention, and clear state semantics.

Follow-up Questions Guidance

  1. How would both participants sending concurrently receive one deterministic conversation order?
  2. What should the sender see when the write committed but its response was lost?
  3. How would a newly linked device obtain history without exposing another account's conversation?
  4. Which design choices change if end-to-end encryption becomes mandatory?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Anthropic•More Software Engineer•Anthropic Software Engineer•Anthropic System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.