← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Coinbase software engineer interview with a Flappy Bird coding problem that sounds goofy but actually has some real depth to it once you get past the naive solution.

Questions Asked (1)

Q1

Implement a function that decides whether a Flappy Bird character should flap its wings on a given frame, using the bird's current position, velocity, and gravity along with upcoming pipe gap locations. The solution is graded against 20 test cases of increasing difficulty.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Started with the obvious thing: if the bird is below the center of the next gap, flap.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: the function must decide whether to flap on a given frame to navigate through upcoming pipe gaps. Then, design a greedy strategy that simulates the bird's trajectory and flaps when necessary to avoid the next gap, while considering velocity and gravity constraints. Finally, discuss how you would validate and refine the solution against the 20 test cases, including edge cases and performance.

Pro tip: Demonstrate a deep understanding of the physics by explaining how you would compute the exact frame to flap to reach the desired height, rather than relying on heuristics. This shows you can derive a precise solution and handle increasing difficulty systematically.

1. Clarify the problem and constraints

Ask questions to understand the game mechanics: how position, velocity, and gravity are updated per frame, the size of the bird and pipes, and the exact goal (e.g., maximize survival or pass all pipes). Confirm the input format and expected output.

2. Model the physics and decision points

Derive the equations of motion: position and velocity updates per frame, and the effect of flapping. Identify the critical decision: whether flapping now will allow the bird to reach the next gap without overshooting or undershooting.

3. Design a greedy or predictive algorithm

Propose a strategy that looks ahead to the next pipe gap and decides to flap if the bird's current trajectory would miss the gap. Consider simulating a few frames ahead to account for velocity changes.

4. Handle edge cases and increasing difficulty

Discuss how the algorithm adapts to tighter gaps, higher speeds, or multiple pipes. Mention potential failure modes (e.g., when the bird is too close to a pipe) and how to mitigate them.

5. Validate and iterate

Explain how you would test the solution against the 20 test cases, starting with simple scenarios and gradually increasing complexity. Use debugging and logging to refine the decision logic.

Key Points to Mention

  • Physics simulation: position, velocity, gravity, and flap impulse
  • Greedy vs. dynamic programming: trade-offs in time and space complexity
  • Lookahead strategy: predicting future positions to make flap decisions
  • Edge cases: bird near ground/ceiling, pipe gaps at extreme heights
  • Test case progression: starting with easy cases to build confidence and identify patterns
  • Performance considerations: ensuring the solution runs within time limits for all test cases

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