Panda Guru LogoPanda
Guru

Uber (Phone) | India | 5 YOE | 95L

Round 1

Questions: Design a data structure to represent a terrain of islands in a sea of water, where each island is denoted by a coordinate (x, y). The data structure needed to support two methods:

Follow-up question:

Candidate's Approach

Initially, the candidate considered using a matrix and then a list but realized that a simple set could effectively represent the islands. The candidate suggested using Union-Find to efficiently handle the island count without recalculating it every time. However, they struggled with the implementation, particularly with path compression and logic gaps, leading to a rushed completion of the code.

Interviewer's Feedback

The interviewer pointed out gaps in the candidate's logic, such as not checking the nei for water and not properly defining what id represented. The interviewer seemed dismissive and in a hurry to wrap up the interview.