PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Oracle

Count Closed Islands

Last updated: Apr 2, 2026

Quick Overview

This question evaluates a candidate's understanding of grid-based connectivity and the ability to detect enclosed regions, testing skills in graph representation, spatial reasoning, and careful handling of boundary conditions.

  • medium
  • Oracle
  • Coding & Algorithms
  • Data Scientist

Count Closed Islands

Company: Oracle

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given an `m x n` binary grid representing terrain after flooding. - `0` = land - `1` = water A land region is an island if its land cells are connected 4-directionally: up, down, left, or right. A closed island is an island that does **not** touch any cell on the outer boundary of the grid. Return the number of closed islands in the grid. The expected approach is a classic DFS or BFS traversal on a 2D grid.

Quick Answer: This question evaluates a candidate's understanding of grid-based connectivity and the ability to detect enclosed regions, testing skills in graph representation, spatial reasoning, and careful handling of boundary conditions.

Related Interview Questions

  • Solve Five Coding Problems - Oracle (medium)
  • Compute letter frequencies from encoded string - Oracle (medium)
  • Count closed islands in a grid - Oracle (easy)
  • Implement in-memory data structures and booking API - Oracle (hard)
  • Implement an LRU cache - Oracle (medium)
Oracle logo
Oracle
Jan 20, 2026, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
2
0
Loading...

You are given an m x n binary grid representing terrain after flooding.

  • 0 = land
  • 1 = water

A land region is an island if its land cells are connected 4-directionally: up, down, left, or right. A closed island is an island that does not touch any cell on the outer boundary of the grid.

Return the number of closed islands in the grid.

The expected approach is a classic DFS or BFS traversal on a 2D grid.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Oracle•More Data Scientist•Oracle Data Scientist•Oracle Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.