Advanced80 min

Collaborative Document Editor

Real-time collaborative editing โ€” where multiple users see each other's changes instantly without conflicts โ€” is one of the most challenging distributed systems problems because it requires resolving concurrent edits while maintaining document consistency and low-latency feedback. In this challenge, you will design a collaborative document editor on AWS that supports Google Docs-style real-time collaboration with cursor presence, change tracking, version history, and offline editing support. The core consistency algorithm uses Conflict-free Replicated Data Types (CRDTs) โ€” specifically, an RGA (Replicated Growable Array) for text content that guarantees eventual consistency without a central coordination server. Each character insertion includes a unique ID (combining client ID and logical timestamp) that provides a total order for conflict resolution. The real-time synchronization layer uses API Gateway WebSocket APIs for persistent connections, with Lambda functions that receive operations from clients, validate them, apply them to the server-side document state in DynamoDB, and broadcast the transformed operations to all other connected clients. The document state is stored as a series of operations (operational log) in DynamoDB with a compacted snapshot stored in S3 at regular intervals โ€” new clients load the latest snapshot and replay subsequent operations to catch up. Cursor presence uses a lightweight heartbeat protocol through the WebSocket connection, with ElastiCache storing cursor positions per user per document with 5-second TTL. Offline editing support works by queuing operations locally on the client and replaying them through the CRDT merge algorithm when connectivity is restored โ€” the CRDT properties guarantee that the result is consistent regardless of the order operations arrive. Version history uses DynamoDB Streams to capture every operation, with a Lambda function that creates named snapshots (versions) on demand and stores them in S3. Access control supports document-level permissions (owner, editor, viewer) stored in DynamoDB with real-time enforcement at the WebSocket authorization layer. This challenge teaches CRDT-based consistency, real-time synchronization protocols, and the architecture patterns behind modern collaborative applications.

AWS Services You'll Use

API GatewayLambdaDynamoDBS3ElastiCacheDynamoDB StreamsCloudFront

Challenge Details

Path
Data-Intensive Systems
Difficulty
Advanced
Duration
80 min
Plan
Pro

Architecture Patterns You'll Learn

CRDToperational transformationevent logsnapshot compactioncursor presence

Why This Challenge?

Unlike whiteboard exercises or multiple-choice quizzes, this challenge requires you to design a real architecture with actual AWS services, evaluate trade-offs, and defend your decisions. Our automated validators check your design against production-grade criteria. Complete it and it shows up in your verified portfolio with your architecture diagram and design rationale.

Ready to design this for real?

Get the full scenario, design your architecture using real AWS services, and validate against production-grade criteria. Your completed challenge shows up in your verified portfolio.

Start Challenge