← Coinbase Interview InsightsSoftware Engineer

Coinbase·Software Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Coinbase SWE interview with a fully open-ended OOD problem where you design a pagination system from scratch, no guardrails, no prescribed interface. The kind of question that feels manageable until you realize you have to justify every single decision you make.

Questions Asked (1)

Q1

Design the API and class structure for a pagination system over a generic collection. You define the interface, the tradeoffs, and justify every choice including cursor vs offset pagination, page size limits, stable ordering, filtering and sorting support, error handling for out-of-range pages or mid-traversal data changes, and how the abstraction works over both in-memory and backed collections.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

The open-endedness is the whole point and also the hardest part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a cursor-based pagination API with a generic Page<T> response, explaining how it supports stable ordering and handles mid-traversal changes. Justify each design choice (cursor vs offset, page size limits, filtering/sorting) by comparing tradeoffs in consistency, performance, and complexity for in-memory vs backed collections.

Pro tip: Emphasize that cursor pagination is essential for financial data where consistency matters, and show how you'd encode the cursor to be opaque and versioned to allow future changes without breaking clients.

1. Clarify requirements and constraints

Ask about expected data volume, consistency needs, and whether the collection is in-memory or backed by a database. This determines the appropriate pagination strategy and error handling.

2. Define the API contract

Specify the request parameters (cursor, page size, filters, sort) and response structure (items, next cursor, total count if available). Decide on cursor vs offset and justify based on stability and performance.

3. Design the class structure

Create a generic Paginator interface with methods like getPage(cursor, size, filter, sort) and implementations for in-memory and backed collections. Use composition to handle filtering and sorting.

4. Address edge cases and error handling

Define behavior for out-of-range cursors, invalid page sizes, and mid-traversal data changes. Use stable ordering (e.g., by unique key) and return informative errors.

5. Discuss tradeoffs and extensions

Compare cursor vs offset, page size limits, and performance implications. Mention how to support filtering and sorting efficiently and how the abstraction adapts to different backends.

Key Points to Mention

  • Cursor vs offset pagination: cursor provides stable ordering and avoids duplicates/skips on data changes, while offset is simpler but inconsistent.
  • Page size limits: enforce a maximum to prevent resource exhaustion and ensure predictable performance.
  • Stable ordering: use a unique, immutable key (e.g., timestamp + ID) to guarantee consistent pagination.
  • Filtering and sorting: apply before pagination; for backed collections, push down to the data store for efficiency.
  • Error handling: return clear errors for invalid cursors or page sizes; handle mid-traversal changes by using cursors that are resilient to inserts/deletes.
  • Abstraction over in-memory and backed collections: define a common interface with methods that can be implemented differently, e.g., using iterators for in-memory and database queries for backed.

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