← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Coinbase software engineer interview with a graph-based coding problem. Pretty focused on efficiency and handling edge cases with lazy user initialization. Felt like a solid technical screen.

Questions Asked (1)

Q1

You're given a stream of events like [user_a, user_b, 'connect'] or [user_a, user_b, 'disconnect']. Connections are undirected. Process all events in order and return how many users end up with more than n connections.

Algorithms & Data StructuresSystem Design
Author's notes

The core trick is that users appear lazily so you can't preallocate anything.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a hash map to track each user's connection count and a set to track unique connections, updating both on connect and disconnect events. After processing all events, count users whose connection count exceeds n.

Pro tip: Clarify edge cases upfront: what if a disconnect occurs for a non-existent connection? Should duplicate connects be ignored? Handling these gracefully shows attention to detail.

1. Clarify requirements and edge cases

Ask about input format, duplicate events, disconnecting non-existent connections, and whether n is inclusive. Confirm expected output.

2. Choose data structures

Use a hash map to store each user's connection count and a set to store unique undirected connections (e.g., sorted tuple or frozenset).

3. Process events sequentially

For each event, update the connection set and adjust counts for both users. On connect, add if new; on disconnect, remove if exists.

4. Count users exceeding n connections

Iterate through the connection count map and count users with count > n. Return the count.

5. Analyze complexity and discuss optimizations

State time O(E) and space O(U + C). Discuss potential optimizations for large-scale streams, like incremental counting.

Key Points to Mention

  • Use of hash map for dynamic connection counts
  • Use of set to avoid double-counting undirected connections
  • Handling duplicate connects and disconnects gracefully
  • Time and space complexity analysis
  • Edge cases: self-connections, disconnecting non-existent connections, n=0
  • Scalability considerations for streaming data

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