Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Comments for a Collaborative Canvas

Design anchored comment threads that stay permission-safe, converge under concurrent edits, and recover real-time delivery after reconnects.

Problem statement

For this exercise, assume authorized workspace members discuss a collaborative canvas through text comment threads.

A member can create a thread anchored either to a stable canvas object or to a normalized canvas position, reply to an open thread, edit or tombstone their own comment, and list threads in a bounded canvas viewport.

Members with edit access can resolve or reopen a thread; a resolved thread remains readable but rejects new replies until reopened. Object anchors move with their object, while deleting the object leaves the thread readable as an orphaned anchor.

Every mutation carries an idempotency key, mutations to an existing thread carry its expected revision, and accepted revisions must never regress.

A connected viewer should receive thread changes within two seconds, but after a delivery gap or reconnect the client must replace stale local state from a snapshot and resume cursor.

Current workspace permissions govern every read and mutation; permission revocation must stop subsequent reads even if caches or subscriptions are stale. Exclude drawing synchronization, voice or video, reactions, file attachments, external guest invitations, full-text search, and notification delivery.

What to build

  1. An authorized member can create an object- or position-anchored thread and idempotently add replies while the thread is open.
  2. Authors can edit or tombstone their own comments, and editors can resolve or reopen a thread through revision-checked transitions.
  3. An authorized viewer can load a bounded viewport snapshot that includes open, resolved, and orphaned thread state without exposing inaccessible content.
  4. Connected viewers receive coalesced thread changes and can detect a gap, reload a consistent snapshot, and resume delivery.

At scalePractice assumption

  • Support 100,000 concurrent canvas viewers, 10,000 accepted comment mutations per second, and bursts of 100,000 subscription deliveries per second.
  • Healthy mutation acknowledgements and viewport reads complete within 300 milliseconds at p95, and accepted changes reach connected viewers within two seconds at p95.
  • A viewport request returns at most 500 threads, and a single hot canvas may have 20,000 connected viewers and one million retained comments.
  • Accepted comment mutations survive a single-zone failure, permission revocations affect subsequent reads within five seconds, and a reconnecting viewer obtains a fresh snapshot and cursor within 30 seconds.