← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Senior

Senior
May 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 interviewer just watches you propose everything and pushes back on your choices.

Questions Asked (1)

Q1

Design the API and class structure for a generic pagination system. You decide the interface, the pagination strategy, and how it handles edge cases like out-of-range pages or data changing mid-traversal.

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 defining a generic pagination interface that separates concerns between data source and pagination strategy. Then walk through the class design, explaining how different strategies (offset, cursor) handle edge cases like out-of-range pages and data mutations, and discuss trade-offs.

Pro tip: Emphasize idempotency and consistency: for financial data, cursor-based pagination with stable sort keys prevents duplicates or missed records when data changes mid-traversal. Mention that you'd validate page size limits and return clear error codes for out-of-range requests.

1. Clarify requirements and constraints

Ask about expected data volume, mutation frequency, consistency needs, and client capabilities (e.g., support for cursors). This shapes the choice of pagination strategy.

2. Define the pagination interface

Design a generic Paginator interface with methods like getPage(cursor, pageSize) and a PageResult containing items, nextCursor, and totalCount (if available). Separate data fetching from pagination logic.

3. Implement pagination strategies

Create concrete strategies: OffsetPaginator (simple but unstable under mutations) and CursorPaginator (stable using sort keys). Explain how each handles out-of-range pages (e.g., return empty page or error) and data changes.

4. Handle edge cases and errors

Define behavior for invalid cursors, page size limits, and concurrent modifications. For cursor-based, use opaque cursors encoding sort key and direction; for offset, document that results may shift.

5. Discuss trade-offs and extensions

Compare strategies on performance, consistency, and complexity. Mention how to add caching, total count estimation, or bidirectional pagination without breaking the interface.

Key Points to Mention

  • Separation of concerns: pagination logic decoupled from data source via generic interface
  • Offset vs. cursor-based pagination: trade-offs in consistency, performance, and complexity
  • Handling data mutations: cursor-based with stable sort keys avoids duplicates/skips
  • Out-of-range pages: return empty result with clear metadata or appropriate error code
  • Opaque cursors: encode necessary state (e.g., last sort key) to prevent client tampering
  • Idempotency and validation: enforce page size limits and validate cursors to avoid abuse

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