FastPrepDetonate the Maximum Bombs
Problems/Detonate the Maximum Bombs

Detonate the Maximum Bombs

Zomato / Eternal logoZomato / Eternal● MediumFULLTIMEPHONE SCREEN

Updated Dec 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Zomato interview for an entry-level backend software engineer. It was the coding question in the first technical round, after a talk about the candidate's past projects. The report says the task was close to a well-known problem: bombs have a location and a blast radius, a bomb that goes off sets off every bomb in its range, and the goal is the largest number of bombs one first bomb can set off. The candidate explained the approach, wrote the code, and then discussed time complexity and edge cases.

The report does not say how the asked task differed from the well-known one, so we use the well-known version as it is. The real question may have changed some detail. The report gives no examples or limits; we use the usual limits for this task, and the examples are our own.

Our version is about 85% the same as the reported question.

You are given a list of bombs. Each bomb is given as bombs[i] = [x_i, y_i, r_i]: the bomb lies at point (x_i, y_i) on a flat plane, and its range is the circle around that point with radius r_i.

When a bomb goes off, it sets off every other bomb whose location is inside its range or exactly on the edge of the circle. Each of those bombs then sets off the bombs in its own range, and so on, until no new bomb goes off.

You may set off exactly one bomb yourself. Return the largest number of bombs that can go off in total, counting the one you set off.

Function

maximumDetonation(bombs: int[][]) → int

Examples

Example 1

bombs = [[1,1,3],[4,1,1],[4,5,4],[8,5,2],[10,5,1]]return = 4

Set off bomb 2 at (4, 5) with radius 4. Bomb 1 at (4, 1) is 4 away, exactly on the edge, and bomb 3 at (8, 5) is 4 away, so both go off. Bomb 3 has radius 2 and bomb 4 at (10, 5) is 2 away, so bomb 4 goes off too. Bomb 0 at (1, 1) is 5 away from bomb 2 and out of reach of bombs 1, 3 and 4, so it stays. That is 4 bombs, and no other first bomb does better.

Example 2

bombs = [[2,2,1],[5,6,5]]return = 2

The bombs are 5 apart. Bomb 1 has radius 5, so bomb 0 is on the edge of its range: setting off bomb 1 sets off both. Bomb 0 has radius 1 and cannot reach bomb 1, so starting there gives only 1. The answer is 2.

Example 3

bombs = [[1,1,1],[10,10,2],[20,1,3]]return = 1

No bomb is inside another bomb's range, so only the bomb you set off goes off. The answer is 1.

Constraints

  • 1 <= bombs.length <= 100
  • bombs[i].length == 3
  • 1 <= x_i, y_i, r_i <= 10^5

More Zomato / Eternal interview questions

  • Friend Circles and Redundant ConnectionsPHONE SCREEN · Seen Sep 2026
  • Find the Two Unique NumbersONSITE INTERVIEW · Seen Oct 2026
  • Flipping MatrixONSITE INTERVIEW · Seen Oct 2026
  • Jump Game IVONSITE INTERVIEW · Seen Oct 2026
  • LFU CacheONSITE INTERVIEW · Seen Aug 2026
  • Maximum Production Within PowerOA · Seen Jul 2026
  • Rearrange Songs by AuthorOA · Seen Jul 2026
  • Robot Warehouse OptimizationOA · Seen Jul 2026
  • Special KeyboardONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Detonate Bombs with Chain ReactionsAirbnb · PHONE SCREENAirbnb interview questions
  • Count Islands in a Binary GridApple · PHONE SCREENApple interview questions
  • Pacific Atlantic Water FlowAnduril · PHONE SCREENAnduril interview questions
  • Count Connected Point ClustersGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Maximum Damage PatchGecko Robotics · OA · PHONE SCREEN
  • Maximum Area of IslandSkydio · PHONE SCREENSkydio interview questions
  • Island Count and Maximum AreaOracle · ONSITE INTERVIEWOracle interview questions
  • Max Area of IslandGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
  • Max Area of IslandRoku · ONSITE INTERVIEWRoku interview questions
  • Max Area of IslandBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
All Zomato / Eternal interview questionsSee Zomato / Eternal hiring insights
Saved
class Solution {
    public int maximumDetonation(int[][] bombs) {
      // Write your code here.
    }

}
Checking account…