← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Coinbase software engineer interview with two back-to-back coding problems, both more involved than I expected for a single session. The second one especially had enough moving parts that I was still mentally untangling it after the call ended.

Questions Asked (2)

Q1

Implement a function that updates a bird's vertical position for one game tick in a Flappy-Bird-style simulator, returning the new position, new velocity, and whether the bird is still within the playable area.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Seemed manageable at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the physics model and boundary conditions first, then implement a pure function that applies gravity and velocity to update position, and finally return the new state with a boolean indicating if the bird is within bounds. Discuss trade-offs between simple Euler integration and more accurate methods, and consider edge cases like boundary collisions.

Pro tip: Explicitly state your assumptions about units, gravity, and boundary behavior, and mention that you'd write unit tests for edge cases like hitting the top/bottom or zero velocity. This shows production-level thinking.

1. Clarify requirements and assumptions

Ask about the physics model (e.g., gravity constant, velocity update order), boundary definitions, and what 'within playable area' means (inclusive/exclusive). Confirm input/output types and whether the function should be pure.

2. Design the update logic

Decide the order of operations: typically update velocity by adding gravity, then update position by adding velocity. Consider if any damping or terminal velocity applies.

3. Implement the function

Write a clean function that takes current position, velocity, and possibly other parameters, and returns new position, new velocity, and a boolean for in-bounds. Use clear variable names and avoid side effects.

4. Handle edge cases and boundaries

Check if the new position is outside the playable area (e.g., y < 0 or y > height). Decide if the bird should be clamped or if the boolean simply indicates out-of-bounds. Consider if velocity should reset on collision.

5. Test and discuss trade-offs

Walk through example scenarios (e.g., bird at top with upward velocity, bird at bottom with downward velocity). Mention potential improvements like using delta time for frame-rate independence or more accurate integration methods.

Key Points to Mention

  • Order of operations: update velocity before position (or vice versa) and its impact on realism.
  • Boundary conditions: inclusive vs exclusive bounds, and whether to clamp position or just report out-of-bounds.
  • Frame-rate independence: using delta time to make the simulation consistent across different tick rates.
  • Numerical integration methods: Euler vs Verlet vs Runge-Kutta, and trade-offs in simplicity vs accuracy.
  • Immutability and pure functions: returning new state instead of mutating inputs, which aids testing and debugging.
  • Testing strategy: unit tests for edge cases like zero velocity, boundary collisions, and extreme values.

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

Q2

Design and implement a greedy block-building algorithm for a simplified cryptocurrency mining simulator, where transactions have fees, sizes, and parent dependencies that must be respected in ordering. Handle dependency cycles and discuss time complexity and caching strategies for large mempools.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This one was a lot.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints and defining the objective (e.g., maximize total fees). Then outline a greedy algorithm that respects dependencies, handles cycles, and optimizes for large mempools using caching and efficient data structures. Finally, analyze time complexity and discuss trade-offs.

Pro tip: Emphasize that dependency cycles are invalid and must be detected and excluded early, and that caching topological order or dependency counts can drastically improve performance for large mempools.

1. Clarify Requirements and Constraints

Ask questions to confirm the goal (e.g., maximize fees), transaction properties (fee, size, dependencies), and constraints (block size limit, mempool size).

2. Design the Greedy Algorithm

Propose a greedy strategy: sort transactions by fee rate (fee/size) descending, then iterate, adding transactions whose dependencies are already included, skipping those with unmet dependencies or cycles.

3. Handle Dependency Cycles

Detect cycles using DFS or topological sort; exclude transactions involved in cycles from consideration.

4. Optimize for Large Mempools

Use caching (e.g., memoize dependency counts, topological order) and efficient data structures (priority queue, hash maps) to avoid recomputation.

5. Analyze Complexity and Trade-offs

Discuss time and space complexity (e.g., O(n log n) for sorting, O(n + e) for cycle detection), and trade-offs between optimality and speed.

Key Points to Mention

  • Greedy selection based on fee rate (fee/size) to maximize fees within block size limit.
  • Dependency resolution using topological sorting or DFS to ensure valid ordering.
  • Cycle detection and exclusion to maintain consistency.
  • Caching strategies: memoizing dependency counts, topological order, or using incremental updates.
  • Time complexity analysis: sorting O(n log n), cycle detection O(n + e), overall O(n log n + e).
  • Trade-offs: greedy may not be optimal; consider dynamic programming for small n, but greedy is efficient for large mempools.

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