FastPrepPop Diagonal Bubbles with Gravity
Problems/Pop Diagonal Bubbles with Gravity

Pop Diagonal Bubbles with Gravity

ZipRecruiter logoZipRecruiter● MediumNEW GRADOA

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two ZipRecruiter OA reports preserve zero empties, selected plus same-color immediate diagonals, empty clicks, downward column gravity, and final board. The stronger source fixes nonrecursive immediate neighbors and valid operations; bounds are supplied.

Zero is empty. For each [row,column], do nothing if empty; otherwise remove the selected bubble and every same-valued immediate diagonal neighbor.

After each removal, compact bubbles downward in every column while preserving vertical order. Return the final board.

Function

popDiagonalBubbles(board: int[][], operations: int[][]) → int[][]

Examples

Example 1

board = [[1,0,1],[0,1,0],[2,2,2]]operations = [[1,1]]return = [[0,0,0],[0,0,0],[2,2,2]]
board
012010110102222
→
return
012000010002222
Moved or new

The center and four diagonal 1s are removed; twos stay at the bottom.

Example 2

board = [[1],[0]]operations = [[1,0]]return = [[1],[0]]
board
00110
→
return
00110

Clicking empty does nothing.

Constraints

  • 1 <= rows,columns,operations.length <= 200
  • Operation coordinates are in range.

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Rotate Matrix Regions Around the DiagonalsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Rotate Matrix Regions Around the DiagonalsHudson River Trading · OAHudson River Trading interview questions
  • Robot Navigation Around LasersRoblox · OARoblox interview questions
  • Leaves Remaining After Wind GustsOpenAI · OAOpenAI interview questions
  • Apply a Reversi MoveAmazon · OA
  • Flip, Invert, and Smooth a Binary ImageAbridge · OAAbridge interview questions
  • Count Straight-Line Word Occurrences in a GridOptiver · OAOptiver interview questions
  • First Completed Mingo LineEpic · OAEpic interview questions
  • Sort Every Matrix Border LayerCapital One · OACapital One interview questions
  • Rotate a Square Matrix ClockwiseVisa · OAVisa interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int[][] popDiagonalBubbles(int[][] board, int[][] operations) {
        // Write your code here.
    }

}
Checking account…