Preparing your design workspace

Loading the problem and your saved attempt…

Design an Annotated Comment Thread System

Model top-level comments, one reply level, parsed user tags, and safe comment interactions.

For this exercise, assume comments attach to one parent resource. A user can add a top-level comment, add one reply to a top-level comment, and include annotations that tag existing user IDs. Replies cannot have replies.

The system parses tag tokens into structured annotations while preserving the original text, rejects malformed or unauthorized tags, and exposes comments in stable creation order. Editing, deletion, reactions, moderation, and notification delivery are outside scope.