PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Coinbase

Design a reusable React comment component

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to design reusable, accessible, and performant React components, encompassing state management, optimistic updates, pagination/infinite scroll, duplicate submission prevention and idempotency considerations, accessibility, and testing strategy.

  • hard
  • Coinbase
  • System Design
  • Software Engineer

Design a reusable React comment component

Company: Coinbase

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design and implement a reusable comment input-and-feed component in React. Requirements: - Allow users to type a comment and submit it to append to the list. - Support deleting individual comments. - Implement backend pagination with infinite scroll; explain scroll detection (e.g., IntersectionObserver), deduplicating requests, end-of-list detection, and empty-state handling. - Model loading states (initial load, load-more, submit, delete) and error states; show appropriate UI. - Prevent duplicate submissions (UI disabling, in-flight tracking, debouncing, and/or idempotency keys) and discuss server-side considerations for idempotency. - Implement optimistic UI for posting and deleting: describe placeholder/tombstone items, reconciliation on success, rollback on failure, and conflict resolution. - Make the component extensible for both a video details page and a live chat/danmaku context; define component boundaries, props/interfaces, render overrides/slots, and discuss state management options (local state vs global store vs React Query), virtualization, throttling/backpressure, and performance under high-throughput updates. - Include accessibility (keyboard navigation, ARIA roles, focus management) and a testing plan (unit, integration, and mocked network).

Quick Answer: This question evaluates a candidate's ability to design reusable, accessible, and performant React components, encompassing state management, optimistic updates, pagination/infinite scroll, duplicate submission prevention and idempotency considerations, accessibility, and testing strategy.

Related Interview Questions

  • Design Crypto Order Routing - Coinbase (hard)
  • Design a crypto trading web frontend - Coinbase (hard)
  • Design query pagination for large datasets - Coinbase (medium)
  • Design a food delivery system - Coinbase (medium)
  • Design real-time crypto prices homepage - Coinbase (hard)
Coinbase logo
Coinbase
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
3
0

Design and Implement a Reusable Comment Input-and-Feed Component in React

Goal

Build a reusable React component that provides a comment input and feed, suitable for both a video details page (slower-paced comments) and a live chat/danmaku context (high-throughput). The component should be resilient, accessible, and performant.

Requirements

  1. Core interactions
  • Users can type a comment and submit it to append/prepend to the list.
  • Users can delete individual comments.
  1. Pagination and infinite scroll
  • Implement backend pagination with infinite scroll.
  • Explain scroll detection (e.g., IntersectionObserver), deduplicating requests, end-of-list detection, and empty-state handling.
  1. Loading and error states
  • Model and display UI for: initial load, load-more, submit, and delete.
  • Model and display error states for these operations.
  1. Prevent duplicate submissions
  • Prevent client-side duplicates via UI disabling, in-flight tracking, and debouncing.
  • Use idempotency keys for submissions; discuss server-side idempotency design.
  1. Optimistic UI
  • Implement optimistic posting and deleting.
  • Describe placeholder/tombstone items, reconciliation on success, rollback on failure, and conflict resolution.
  1. Reusability and extensibility
  • Make the component extensible for both a video details page and a live chat/danmaku context.
  • Define component boundaries, props/interfaces, render overrides/slots.
  • Discuss state management options (local state vs global store vs React Query), virtualization, throttling/backpressure, and performance under high-throughput updates.
  1. Accessibility
  • Include keyboard navigation, ARIA roles, and focus management.
  1. Testing plan
  • Provide a testing strategy covering unit, integration, and mocked network tests.

Assume a typical REST API with cursor-based pagination. If something is unspecified, make minimal explicit assumptions and state them.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.