← Coinbase Interview Insights

Coinbase·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

Coinbase system design round for a software engineer role. The problem was a transaction query module with filtering and cursor-based pagination, which sounds manageable until you realize how many edge cases they actually want you to think through.

Questions Asked (1)

Q1

Design and implement a transaction query module over a dataset where each transaction has a start date, end date, user ID, and amount. The module should support per-field filters via setter methods that combine conjunctively, plus cursor-based pagination with a defined sort key, opaque cursor encoding, and handling of empty pages, end-of-results, and data mutations between page requests. Include API signatures and complexity analysis.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This one is deceptively wide.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design the API with setter methods for conjunctive filters and cursor-based pagination. Explain the cursor encoding, sort key, and how to handle edge cases like empty pages and data mutations. Finally, provide complexity analysis and discuss trade-offs.

Pro tip: Emphasize idempotency and consistency: use a stable sort key (e.g., timestamp + ID) and encode the last seen values in the cursor to avoid duplicates or missed records when data changes between requests.

1. Clarify Requirements and Constraints

Ask about data volume, expected query patterns, consistency requirements, and whether mutations are frequent. Confirm the need for conjunctive filters and cursor-based pagination.

2. Design the API

Define setter methods for each filter field (start date, end date, user ID, amount) that combine with AND logic. Specify a method to execute the query with a cursor and limit, returning a page of results and a next cursor.

3. Implement Cursor-Based Pagination

Choose a sort key (e.g., start_date, then transaction_id). Encode the last record's sort key values into an opaque cursor (e.g., Base64-encoded JSON). On subsequent requests, use the cursor to fetch records after the last seen key.

4. Handle Edge Cases and Mutations

Address empty pages by returning an empty list and null cursor. Detect end-of-results when no more records match. For data mutations, use the cursor to maintain a stable snapshot or acknowledge potential inconsistencies and suggest strategies like versioning or time-travel queries.

5. Analyze Complexity and Trade-offs

Discuss time complexity of filtering and pagination (e.g., O(log n + k) with indexed sort key). Compare cursor-based vs offset pagination. Mention trade-offs between consistency and performance.

Key Points to Mention

  • Conjunctive filters via setter methods that build a query object.
  • Cursor encoding: opaque, typically Base64 of JSON containing sort key values.
  • Stable sort key (e.g., start_date + transaction_id) to ensure deterministic ordering.
  • Handling empty pages: return empty result set and null cursor.
  • End-of-results detection: when returned records < limit or no next cursor.
  • Data mutations: cursor-based pagination avoids duplicates/skips compared to offset; consider snapshot isolation or versioning for consistency.

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