← Coinbase Interview Insights

Coinbase·Frontend Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Coinbase frontend round, one meaty coding question about building a blog app that pulls from two APIs and stitches the data together client-side. More design discussion than I expected for a frontend screen.

Questions Asked (2)

Q1

You're building a blog app in React. Posts come from a GET /posts endpoint and include an authorId. Users come from a separate GET /users endpoint. How do you fetch and render each post with the correct author name, and show 'you' for posts belonging to the logged-in user?

API & IntegrationsTechnical Trade-offsSystem Design
Author's notes

I jumped straight into fetching both endpoints in parallel with Promise.all, which felt right, then building a lookup map from userId to display name before rendering.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by fetching both endpoints in parallel, then join the data client-side using authorId. Render each post with the resolved author name, substituting 'you' when the authorId matches the logged-in user's ID. Discuss trade-offs like caching, error handling, and scalability.

Pro tip: Mention that you'd normalize the data into a map for O(1) lookups and consider using React Query or SWR for caching and deduplication, which shows production awareness.

1. Fetch data in parallel

Use Promise.all to fetch posts and users simultaneously, minimizing latency. Handle loading and error states for both requests.

2. Join data efficiently

Create a lookup map of users by ID (e.g., using reduce) to avoid O(n²) nested loops when matching authorId to user.

3. Render with conditional display

For each post, look up the author name from the map. If the authorId equals the logged-in user's ID, display 'you' instead of the name.

4. Optimize and handle edge cases

Consider caching, pagination, or server-side joins for large datasets. Handle missing users (e.g., deleted accounts) gracefully.

Key Points to Mention

  • Parallel fetching with Promise.all to reduce waterfall requests
  • Client-side join using a map for O(1) author lookups
  • Conditional rendering for 'you' based on logged-in user ID
  • Caching strategies (e.g., React Query, SWR) to avoid refetching
  • Error handling and loading states for both endpoints
  • Scalability trade-offs: client-side vs. server-side join, pagination

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you cache the users list, and what's your approach to loading and error states for both API calls?

API & IntegrationsTechnical Trade-offs
Author's notes

Talked through memoizing the users fetch so repeat renders don't re-request, maybe storing it in context or a lightweight cache depending on app size.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the caching strategy for the users list, such as using a client-side cache with a library like React Query or SWR, and discuss cache invalidation and staleness. Then, for both API calls, outline a consistent approach to loading and error states, including UI feedback, retry mechanisms, and graceful degradation. Emphasize trade-offs between simplicity and robustness, and how you would handle edge cases like partial failures.

Pro tip: Mention that you would implement optimistic updates for mutations to the users list to improve perceived performance, and use error boundaries to isolate failures. Also, highlight the importance of logging and monitoring to track cache hit rates and error frequencies.

1. Clarify requirements and constraints

Ask about the expected frequency of updates, data size, and whether the users list is shared across components. This determines if a simple in-memory cache or a more sophisticated solution like IndexedDB is needed.

2. Choose a caching strategy

Propose using a library like React Query or SWR for declarative caching, with stale-while-revalidate and automatic retries. Discuss cache invalidation strategies (e.g., time-based or manual) and how to handle mutations.

3. Design loading states

For both API calls, use skeleton loaders or spinners to indicate loading, and consider showing cached data while revalidating in the background. Ensure loading states are accessible and don't cause layout shifts.

4. Design error states

Implement error boundaries or error UI components that display user-friendly messages and retry options. For the users list, consider showing stale data with an error banner if the refresh fails.

5. Discuss trade-offs and edge cases

Compare custom caching vs. library solutions, and address scenarios like race conditions, offline support, and cache consistency across tabs. Mention how you would test these states.

Key Points to Mention

  • Use of React Query/SWR for caching, with stale-while-revalidate and automatic retries
  • Cache invalidation strategies (time-based, manual, or on mutation)
  • Loading states: skeleton loaders, spinners, and showing cached data during revalidation
  • Error states: error boundaries, retry mechanisms, and fallback UI
  • Optimistic updates for mutations to improve perceived performance
  • Monitoring and logging for cache hit rates and error tracking

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.