Design Real-Time Comments with Optimistic Updates

Read the full interview experience this question came from →

Quick Overview

Design optimistic real-time comments with temporary identities, idempotent posting, response/event reconciliation, visible failure states, and durable history.

Design Real-Time Comments with Optimistic Updates

Company: Cohere

Role: Frontend Engineer

Category: System Design

Difficulty: medium

Interview Round: Other

Design a real-time comment system with optimistic posting. When a user submits a comment, append it to the visible list immediately so the user can continue interacting while the backend request completes. ### Constraints & Assumptions The source emphasizes optimistic updates. Define ordering and delivery behavior, and include durable history and failure recovery. Do not assume that rendering a pending comment means the server accepted it. ### Clarifying Questions Can comments be edited or deleted? How are comments ordered? What happens after a timeout with an unknown commit outcome? Must another device see the same conversation? ### What a Strong Answer Covers Temporary and server identities, idempotent creation, acknowledgment reconciliation, live events, pending/error states, and retry behavior. ### Follow-up Questions What if a live event arrives before the POST response? How do you avoid duplicate comments on retry? What if the server rejects content or the user navigates away?

Overview: Design optimistic real-time comments with temporary identities, idempotent posting, response/event reconciliation, visible failure states, and durable history.

Read the full Cohere Frontend Engineer interview experience this question came from

|Home/System Design/Cohere
Cohere logo
Cohere
Sep 15, 2026
mediumFrontend EngineerOtherSystem Design
0
0

Design a real-time comment system with optimistic posting. When a user submits a comment, append it to the visible list immediately so the user can continue interacting while the backend request completes.

Constraints & Assumptions

The source emphasizes optimistic updates. Define ordering and delivery behavior, and include durable history and failure recovery. Do not assume that rendering a pending comment means the server accepted it.

Clarifying Questions Guidance

Can comments be edited or deleted? How are comments ordered? What happens after a timeout with an unknown commit outcome? Must another device see the same conversation?

What a Strong Answer Covers Guidance

Temporary and server identities, idempotent creation, acknowledgment reconciliation, live events, pending/error states, and retry behavior.

Follow-up Questions Guidance

What if a live event arrives before the POST response? How do you avoid duplicate comments on retry? What if the server rejects content or the user navigates away?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...