← Coinbase Interview InsightsFrontend Engineer

Coinbase·Frontend Engineer·Take-home Assignment·Senior

Senior
Jun 2026

Summary

Coinbase frontend take-home that looked manageable on paper but had enough moving parts to trip you up if you underestimated the scope. The prompt was well-written at least, no ambiguity about what they wanted.

Questions Asked (4)

Q1

Build a list component app with API data fetching, per-item reordering controls, loading/error states, and proper request cancellation on unmount or overlapping calls.

API & IntegrationsTechnical Trade-offs
Author's notes

The request cancellation piece is where I spent way too long.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then outline a component architecture that separates data fetching, state management, and UI. Emphasize robust async handling with AbortController for cancellation, and discuss trade-offs between libraries (e.g., React Query) and custom hooks. Conclude with testing and edge cases.

Pro tip: Demonstrate awareness of race conditions by using a request ID or AbortController to ignore stale responses, and mention how you'd handle optimistic UI updates for reordering to keep the app responsive.

1. Clarify Requirements & Constraints

Ask about expected data volume, reordering semantics (drag-and-drop vs. buttons), and whether reordering should persist to the server. Confirm if there are existing patterns or libraries in the codebase.

2. Design Component Architecture

Propose a container component that fetches data and manages state, with presentational child components for the list and items. Use a custom hook (e.g., useFetch) to encapsulate fetching, loading, error, and cancellation logic.

3. Implement Data Fetching with Cancellation

Use AbortController to cancel in-flight requests on unmount or when a new request supersedes an old one. Track loading and error states, and ensure stale responses are ignored via a request ID or abort signal.

4. Handle Reordering & State Updates

Implement reordering controls (e.g., up/down buttons or drag-and-drop) that update local state optimistically. If persisting to server, debounce or batch updates and handle rollback on failure.

5. Address Edge Cases & Testing

Discuss handling empty states, retry logic, and accessibility (keyboard controls for reordering). Outline unit tests for the hook and integration tests for the component, mocking API calls and simulating unmount.

Key Points to Mention

  • Use AbortController to cancel fetch requests on unmount or when a new request starts.
  • Prevent race conditions by ignoring stale responses using a request ID or abort signal.
  • Manage loading, error, and empty states with clear UI feedback (spinners, error messages, retry buttons).
  • Optimistic UI updates for reordering to improve perceived performance, with rollback on API failure.
  • Consider using a data-fetching library like React Query or SWR for built-in caching and cancellation.
  • Ensure accessibility: keyboard navigable reorder controls and ARIA live regions for state changes.

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

Q2

Implement 'up' and 'down' reordering controls per list item, with the boundary items' controls disabled, and use stable keys throughout.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Stable keys bit me a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: reordering controls per list item, disabled at boundaries, and stable keys. Then outline a component-based solution using a state array and swap operations, emphasizing immutability and key stability. Finally, discuss trade-offs like performance and accessibility.

Pro tip: Mention that stable keys should be based on a unique identifier from the data, not the index, to prevent React reconciliation issues. Also, consider using CSS to visually disable controls while keeping them in the DOM for accessibility.

1. Clarify Requirements

Confirm the expected behavior: up/down buttons per item, disabled at first/last positions, and stable keys for list items. Ask about data source and any constraints.

2. Design Component Structure

Propose a parent component managing the list state and child components for each item with up/down controls. Use a unique ID from each item as the key.

3. Implement Reordering Logic

Write a function that swaps items in the array immutably, e.g., using slice or array destructuring. Ensure the state update triggers re-render with correct disabled states.

4. Handle Boundary Conditions

Disable the up button for the first item and the down button for the last item. Use conditional rendering or disabled attribute based on index.

5. Discuss Trade-offs and Enhancements

Talk about performance (e.g., using React.memo), accessibility (aria-labels, keyboard support), and potential optimizations like drag-and-drop.

Key Points to Mention

  • Use stable keys from data IDs, not array indices, to avoid reconciliation bugs.
  • Immutable state updates: create a new array instead of mutating the existing one.
  • Disable controls at boundaries using index checks (index === 0 for up, index === length-1 for down).
  • Accessibility: add aria-labels to buttons and ensure disabled state is conveyed to screen readers.
  • Performance: consider memoizing list items to prevent unnecessary re-renders.
  • Trade-offs: swapping vs. moving items, and potential use of libraries like react-beautiful-dnd for complex cases.

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

Q3

Write unit and component tests covering rendering, data fetching behavior, reordering logic, and edge cases.

Technical Trade-offsAPI & Integrations
Author's notes

I spent less time on tests than I should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the component's responsibilities and the testing tools (e.g., Jest, React Testing Library). Then outline a test plan that covers rendering, data fetching (with mocked APIs), reordering logic (including drag-and-drop or state updates), and edge cases like empty states and errors. Emphasize maintainability and alignment with Coinbase's quality standards.

Pro tip: Demonstrate maturity by discussing test trade-offs: e.g., avoiding over-mocking to keep tests realistic, and using integration tests for data fetching to catch real-world issues. Mention how you'd structure tests for readability and fast feedback.

1. Understand the component and requirements

Identify the component's props, state, and interactions. Clarify what 'reordering' means (e.g., drag-and-drop, up/down buttons) and what data fetching entails (API endpoints, loading/error states).

2. Set up testing environment and tools

Choose tools like Jest and React Testing Library. Mock API calls with jest.mock or MSW. Set up utilities for rendering with providers (e.g., Redux, Router).

3. Write tests for rendering and data fetching

Test initial render with default props, loading state, and successful data fetch. Use waitFor or findBy to handle async. Test error states and empty data.

4. Test reordering logic and edge cases

Simulate user interactions (e.g., drag events, button clicks) and assert the new order. Cover edge cases: reordering with one item, empty list, API failure during reorder, and optimistic updates.

5. Review and refine for maintainability

Ensure tests are isolated, readable, and fast. Use descriptive test names. Consider adding integration tests for critical flows and snapshot tests sparingly.

Key Points to Mention

  • Mocking API calls with tools like MSW or jest.mock to test data fetching without hitting real endpoints.
  • Testing loading, success, and error states for data fetching, including retry logic if applicable.
  • Simulating reordering via user events (e.g., fireEvent.drag, userEvent.click) and asserting DOM order or state changes.
  • Edge cases: empty list, single item, network errors, and reordering with disabled items.
  • Using React Testing Library's async utilities (waitFor, findBy) to handle asynchronous updates.
  • Trade-offs: unit vs. integration tests, test coverage vs. maintainability, and avoiding implementation details.

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

Q4

Structure the app with clear separation between data-fetching logic and presentation components, and ensure accessibility including keyboard navigation, aria labels, and focus management.

System DesignTechnical Trade-offs
Author's notes

Focus management after reordering is something I genuinely hadn't thought about before.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the app's requirements and constraints, then propose a layered architecture that separates data fetching (e.g., custom hooks, services) from presentational components. Emphasize accessibility as a first-class concern, detailing keyboard navigation, ARIA roles, and focus management strategies. Conclude by discussing trade-offs and how you would test and validate the approach.

Pro tip: Frame accessibility not as a checklist but as a core part of the component API design—this shows you understand that a11y and clean architecture reinforce each other. Also, mention specific tools like React Testing Library with jest-axe to demonstrate practical validation.

1. Clarify Requirements and Constraints

Ask questions to understand the app's scope, data sources, performance needs, and accessibility standards (e.g., WCAG 2.1 AA). This ensures your design is tailored and shows you think before coding.

2. Design Data Layer Separation

Propose a clear separation: data fetching logic in custom hooks or services, and presentational components that receive data via props. Discuss patterns like container/presenter, render props, or hooks to achieve this.

3. Integrate Accessibility into Components

Detail how each component will support keyboard navigation (e.g., tabindex, onKeyDown), ARIA labels/roles, and focus management (e.g., focus trapping in modals, restoring focus). Emphasize semantic HTML as the foundation.

4. Address Trade-offs and Edge Cases

Discuss trade-offs such as performance vs. accessibility, complexity of state management, and how to handle async data loading with screen readers (e.g., aria-live regions). Mention testing strategies for both layers.

5. Summarize and Validate

Recap the architecture and a11y approach, and propose validation methods like unit tests, integration tests with axe, and manual keyboard testing. This shows end-to-end thinking.

Key Points to Mention

  • Custom hooks for data fetching (e.g., useQuery, useFetch) to encapsulate logic and promote reusability.
  • Presentational components as pure functions that receive data and callbacks via props, ensuring testability and separation of concerns.
  • Keyboard navigation: ensuring all interactive elements are focusable and operable via keyboard, with logical tab order.
  • ARIA attributes: using roles, labels, and states (e.g., aria-expanded, aria-hidden) appropriately, and avoiding redundant ARIA when semantic HTML suffices.
  • Focus management: trapping focus in modals, restoring focus after closing, and managing focus on route changes.
  • Testing accessibility: using tools like jest-axe, eslint-plugin-jsx-a11y, and manual testing with screen readers.

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