← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jul 2026Remote

Summary

Coinbase technical screen with a pretty gnarly combinatorics problem about NFT generation. Not your typical coding question, it pushed into system design territory fast.

Questions Asked (1)

Q1

You're generating NFTs randomly where each NFT is one value chosen per attribute category (like ear, eye, background). How do you guarantee no duplicates are produced across a large generated set?

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

I started with the hash set approach because it felt obvious, track each tuple you've seen and reject on collision.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and constraints (e.g., total possible combinations, generation rate). Then propose a strategy that balances memory usage and collision probability, such as using a hash set for exact tracking or a deterministic permutation for guaranteed uniqueness. Finally, discuss trade-offs and scalability, including distributed generation considerations.

Pro tip: Mention that if the total number of combinations is known and manageable, you can pre-generate all combinations and shuffle them, then assign sequentially—this guarantees uniqueness with O(1) lookup and no collision checks. For very large sets, consider using a Bloom filter with a secondary exact check to reduce memory overhead.

1. Clarify Requirements and Constraints

Ask about the total number of possible combinations, the expected size of the generated set, and whether generation is centralized or distributed. This determines the appropriate strategy.

2. Evaluate Uniqueness Strategies

Compare approaches: exact tracking with a hash set, deterministic generation via permutation, or probabilistic methods like Bloom filters. Discuss memory and time complexity for each.

3. Design for Scale and Distribution

If generation is distributed, propose using a centralized database with unique constraints, or partitioning the combination space to avoid collisions. Consider using a deterministic algorithm with a seed to ensure reproducibility.

4. Address Edge Cases and Failures

Discuss handling of collisions (e.g., retry with a new random value), exhaustion of the combination space, and persistence of generated NFTs to avoid duplicates across sessions.

5. Summarize Trade-offs and Recommendation

Conclude with a recommended approach based on the constraints, highlighting trade-offs between memory, speed, and complexity.

Key Points to Mention

  • Total number of possible combinations (product of attribute category sizes) and its relation to the generated set size.
  • Using a hash set or database unique index for exact duplicate detection.
  • Deterministic generation via permutation (e.g., Fisher-Yates shuffle) when the combination space is finite and manageable.
  • Probabilistic data structures like Bloom filters for memory-efficient approximate membership, with a fallback to exact checks.
  • Distributed generation challenges: coordination, partitioning, and idempotency.
  • Handling collisions and retries, and ensuring persistence to avoid duplicates across restarts.

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