Java Interview with a FAANG engineer.

Java Interview with a FAANG engineer

Interview Summary

Problem type: Shortest Path in Binary Matrix
Interview question: Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.

A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:

Example 1.

Input: grid =

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

Output: length = 4

Example 2.

Input: grid =

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

Output: -1

Interview Feedback

Feedback about Effulgent Covariate (the interviewee)

Thank you for another productive session. We focused on a DSA problem where there were several positive signals and some mixed. Recommendation for next session: After you've completed a majority of 3 or 4 first sections on Neetcode 150, let's focus a DSA round on one of those (could be 'mock' or 'mentorship').

Strengths:

Potential areas of improvement

Interview Transcript

Effulgent Covariate: Yeah. So mainly my focus has been working my way through the... Stochastic Panda: A bit of both would be great.

[Discussion about approaches for problem-solving]

Effulgent Covariate: I felt like if I got to the graphing section of the practice, I probably would have done a lot better on this.

Stochastic Panda: I stood out that your intuition for finding an algorithm is a lot better and faster.

Further suggestions