Build a Reddit-style nested comments system with infinite nesting, collapse, voting, and optimistic replies.
Skip to solutionKEEP THE
hardFrontend
Build Nested Comments with Collapsible Threads & Voting
281 views
01
Understand the problem
ReactNested CommentsTreeOptimistic
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Nudge consolestandby
Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.
03
Study the solution
Requirements
- Recursive comments
{id, author, body, votes, children[]}; indent per depth with thread line. - Actions: reply (inline editor), collapse thread, upvote/downvote (optimistic), edit/delete own comment.
- Sort by Best/New (score = upvotes - downvotes); highlight new comments since last visit.
**Archit
Solution ready — 2 min read
Classified // press E to declassify
04
Join the discussion
Discussion (0)
Sign in to join the discussion.
No responses yet. Be the first to share what you think.
Transmission complete // awaiting log
KEEP THE
STREAK ALIVE.
Dossier 85 of 87 decoded in the Frontend Machine Coding track. One more won't hurt.