Google interview questions

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-06-06Added By Anonymous
Source: Link

recently came across google coding round onsite

1.Find number of lakes in atlantic pacific ocean
2.Given row,col find the number of lakes for given row,col.
3.Matrix is reprenated by 1' and 0's. => 1 being land 0 being water.
4.for land 1's find the number of 0's covered by 1's.
5.Strategy:

1) find land using DFS and keep track of lands pixels

2) for given row,col , if its part of land then go for dfs on land and find the number of lakes by validating and visiting 0's present or not.


Note: forgot to handle edge cases.


veridct : NH


Comments