PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Coinbase

Implement a Flappy Bird Jump Agent

Last updated: May 3, 2026

Quick Overview

This question evaluates discrete-time physics simulation, real-time decision-making under constraints, collision detection, and deterministic control-policy design that prioritizes survival.

  • Coinbase
  • Coding & Algorithms
  • Software Engineer

Implement a Flappy Bird Jump Agent

Company: Coinbase

Role: Software Engineer

Category: Coding & Algorithms

Interview Round: Technical Screen

Implement a function `should_jump(state) -> bool` for a simplified Flappy Bird game. The bird has a fixed horizontal position `bird_x` and a vertical position `bird_y`. Smaller `y` means the bird is higher on the screen. The current game state contains: - `bird_y`: current vertical position - `bird_v`: current vertical velocity - `bird_x`: current horizontal position - `screen_height`: height of the screen - `next_pipe`: an object with: - `x`: left edge of the next pipe - `width`: pipe width - `gap_top`: top boundary of the gap - `gap_bottom`: bottom boundary of the gap Game physics: - If the bird jumps on the current frame, its velocity becomes `-8`. - Gravity is `+1` per frame. - Each frame updates in this order: 1. `y += v` 2. `v += 1` - The pipe moves left by `1` unit per frame. - The bird dies if it goes outside the screen bounds or hits a pipe. - A collision with the pipe happens when the bird's `x` lies within the pipe's horizontal range and the bird's `y` is not strictly inside the gap `(gap_top, gap_bottom)`. Return `true` if the bird should jump on the current frame, or `false` otherwise. Your policy should be deterministic and should prioritize survival, especially when the bird is close to the ground or approaching the next pipe at an unsafe height.

Quick Answer: This question evaluates discrete-time physics simulation, real-time decision-making under constraints, collision detection, and deterministic control-policy design that prioritizes survival.

Related Interview Questions

  • Implement a Coin-Constrained Jump Strategy - Coinbase (hard)
  • Implement an In-Memory Database - Coinbase (hard)
  • Implement Game Physics and Block Mining - Coinbase (hard)
  • Compute Total Manual Distance - Coinbase (medium)
  • Implement Plus One - Coinbase (medium)
|Home/Coding & Algorithms/Coinbase

Implement a Flappy Bird Jump Agent

Coinbase logo
Coinbase
Mar 25, 2026, 12:00 AM
Software EngineerTechnical ScreenCoding & Algorithms
4
0
Practice Read
Loading...

Implement a function should_jump(state) -> bool for a simplified Flappy Bird game.

The bird has a fixed horizontal position bird_x and a vertical position bird_y. Smaller y means the bird is higher on the screen. The current game state contains:

  • bird_y : current vertical position
  • bird_v : current vertical velocity
  • bird_x : current horizontal position
  • screen_height : height of the screen
  • next_pipe : an object with:
    • x : left edge of the next pipe
    • width : pipe width
    • gap_top : top boundary of the gap
    • gap_bottom : bottom boundary of the gap

Game physics:

  • If the bird jumps on the current frame, its velocity becomes -8 .
  • Gravity is +1 per frame.
  • Each frame updates in this order:
    1. y += v
    2. v += 1
  • The pipe moves left by 1 unit per frame.
  • The bird dies if it goes outside the screen bounds or hits a pipe.
  • A collision with the pipe happens when the bird's x lies within the pipe's horizontal range and the bird's y is not strictly inside the gap (gap_top, gap_bottom) .

Return true if the bird should jump on the current frame, or false otherwise.

Your policy should be deterministic and should prioritize survival, especially when the bird is close to the ground or approaching the next pipe at an unsafe height.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.