PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Coinbase

Implement a blog feed with fetching and state

Last updated: Mar 29, 2026

Quick Overview

This question evaluates client-side React skills including state management, asynchronous data fetching, optimistic UI updates, and deterministic sorting and deletion behavior for a blog feed.

  • medium
  • Coinbase
  • Software Engineering Fundamentals
  • Software Engineer

Implement a blog feed with fetching and state

Company: Coinbase

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You are building a simple **Blog Posts** page (React). Implement the UI and client-side logic in incremental steps. ## Data model Assume each post has at least: - `id: string` - `authorId: string` - `content: string` - `createdAt: ISO string` - `likeCount: number` - `lastLikedAt: ISO string | null` (timestamp when this post most recently received a like; `null` if never) Assume each user has: - `id: string` - `name: string` ## Step 1 — Render local posts - Posts are initially available from a **local JSON file** (or in-memory constant). - Render a list of posts. ## Step 2 — Add “create post” - Add a `textarea` and a submit button. - On submit, create a new post and update **local React state** so the UI updates immediately. - The newly created post must appear in the feed as if it was posted “now”. ## Step 3 — Fetch posts + users; show “you” Replace the local JSON source with API calls: - Fetch posts from an API endpoint (e.g., `GET /api/posts`). - Each post contains `authorId` (not the author name). - Fetch user info so you can display author names (e.g., `GET /api/users/:id`), and fetch the **current user** (e.g., `GET /api/me`). - When rendering posts authored by the current user, display the author label as **"you"** instead of their username. ## Step 4 — Sort by likes; allow delete for own posts - Sort posts by: 1. `likeCount` descending. 2. If `likeCount` is tied, the post that was **most recently liked** (`lastLikedAt` descending) comes first. - For posts authored by the current user: - show a **Delete** button. - clicking Delete removes the post by updating local state (no server required for this step). - The ordering must remain correct after: - creating a new post, - deleting a post, - likes changing (if the UI updates `likeCount`/`lastLikedAt`). ### Notes - You may assume reasonable API responses and can define any missing minor fields needed to meet the requirements (e.g., generating `id`/timestamps for new local posts). - Focus on correctness, resilience to async fetch timing, and clean state management.

Quick Answer: This question evaluates client-side React skills including state management, asynchronous data fetching, optimistic UI updates, and deterministic sorting and deletion behavior for a blog feed.

Related Interview Questions

  • Debug and Extend Cursor Queries - Coinbase (hard)
  • Design a task management system with TTL - Coinbase (medium)
  • Implement a Reusable Dropdown Component - Coinbase (hard)
  • Implement debounced async autocomplete input - Coinbase (medium)
|Home/Software Engineering Fundamentals/Coinbase

Implement a blog feed with fetching and state

Coinbase logo
Coinbase
Jan 6, 2026, 12:00 AM
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
7
0
Loading...

You are building a simple Blog Posts page (React). Implement the UI and client-side logic in incremental steps.

Data model

Assume each post has at least:

  • id: string
  • authorId: string
  • content: string
  • createdAt: ISO string
  • likeCount: number
  • lastLikedAt: ISO string | null (timestamp when this post most recently received a like; null if never)

Assume each user has:

  • id: string
  • name: string

Step 1 — Render local posts

  • Posts are initially available from a local JSON file (or in-memory constant).
  • Render a list of posts.

Step 2 — Add “create post”

  • Add a textarea and a submit button.
  • On submit, create a new post and update local React state so the UI updates immediately.
  • The newly created post must appear in the feed as if it was posted “now”.

Step 3 — Fetch posts + users; show “you”

Replace the local JSON source with API calls:

  • Fetch posts from an API endpoint (e.g., GET /api/posts ).
  • Each post contains authorId (not the author name).
  • Fetch user info so you can display author names (e.g., GET /api/users/:id ), and fetch the current user (e.g., GET /api/me ).
  • When rendering posts authored by the current user, display the author label as "you" instead of their username.

Step 4 — Sort by likes; allow delete for own posts

  • Sort posts by:
    1. likeCount descending.
    2. If likeCount is tied, the post that was most recently liked ( lastLikedAt descending) comes first.
  • For posts authored by the current user:
    • show a Delete button.
    • clicking Delete removes the post by updating local state (no server required for this step).
  • The ordering must remain correct after:
    • creating a new post,
    • deleting a post,
    • likes changing (if the UI updates likeCount / lastLikedAt ).

Notes

  • You may assume reasonable API responses and can define any missing minor fields needed to meet the requirements (e.g., generating id /timestamps for new local posts).
  • Focus on correctness, resilience to async fetch timing, and clean state management.
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ 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
  • AI Coding 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.