FastPrepLargest Island After One Land Conversion
Problems/Largest Island After One Land Conversion

Largest Island After One Land Conversion

Bloomberg LP logoBloomberg LP● HardNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Bloomberg new-grad reports name this exact well-known problem. Our version is about 100% the same as the reported question.

Given a rectangular binary grid, you may change at most one 0 into 1. An island is a four-directionally connected group of ones. Return the largest island area obtainable after the optional conversion.

Function

largestIsland(grid: int[][]) → int

Examples

Example 1

grid = [[1,0],[0,1]]return = 3
grid
01010101

Converting either zero joins both diagonal land cells through the converted cell.

Example 2

grid = [[1,1],[1,0]]return = 4
grid
01011110

Converting the only zero makes the complete grid one island.

Constraints

  • 1 <= grid.length, grid[i].length <= 500
  • grid[i][j] is 0 or 1
  • four-directional adjacency defines an island

More Bloomberg LP Onsite Interview questions

  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Largest Island After One Land ConversionAmazon · ONSITE INTERVIEW
  • Largest Island After One Land ConversionGoogle · ONSITE INTERVIEWGoogle interview questions
  • Making a Large IslandMeta · ONSITE INTERVIEWMeta interview questions
  • Evaluate DivisionPlaud · ONSITE INTERVIEW
  • Count Friend CirclesOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Redundant ConnectionMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Count Connected Components in an Undirected GraphNutanix · ONSITE INTERVIEWNutanix interview questions
  • Connected GroupsFivetran · ONSITE INTERVIEWFivetran interview questions
  • Evaluate DivisionApple · PHONE SCREENApple interview questions
  • Minimum Unreachable WarehousesVisa · OAVisa interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int largestIsland(int[][] grid) {
        // Write your code here.
    }

}
Checking account…