Java Interview with a FAANG engineer.

Java Interview with a FAANG engineer

Interview Summary

Problem type
Number of Unique Islands

Interview question
Given: A 2D array of integers representing land and water.
Values of 0 represent water. Values of 1 are land.
An "island" is a set of adjacent (N, S, E, or W) values = 1.
Your task: count the number of unique island shapes.

For example:

[[1, 1, 0, 0, 0, 0, 0],  
 [1, 0, 0, 0, 1, 1, 0],  
 [1, 0, 0, 0, 0, 1, 0],  
 [0, 0, 1, 1, 0, 0, 0],  
 [0, 0, 1, 0, 0, 1, 1],  
 [0, 0, 1, 0, 0, 1, 0]]  

There are four islands.
The islands in the top left, and bottom 3rd column are the same shape.

Interview Feedback

Feedback about Hyper Bandit (the interviewee)
Advance this person to the next round?
Yes

How were their technical skills?
3/4
How was their problem solving ability?
3/4
What about their communication ability?
2/4

Great interview. Good intuition and approach. Some prompting required to head in the right direction.

What went well:

Room for improvement:

Feedback about Metal Taco (the interviewer)
Would you want to work with this person?
Yes
How excited would you be to work with them?
4/4
How good were the questions?
4/4
How helpful was your interviewer in guiding you to the solution(s)?
4/4

Interview Transcript

Metal Taco: Hello. How are you doing?
Hyper Bandit: Good, how are you doing?
Metal Taco: Fantastic, thank you. A pleasure to virtually meet you. Looks like we have a standard algorithmic interview for today.
Hyper Bandit: Okay.
Metal Taco: Alright, your lucky question today's...

Hyper Bandit: I'm thinking of doing it by going through the 2D array and once I meet a one, I will use a helper function...

Metal Taco: That sounds like a good approach to start with.

Key Concepts