Facebook(Meta)|Phone Interview |Find path from (0,0) to end in matrix

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2021-12-02Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: e3
Interview Stage: Phone Interview
Location: unknown
Year: 2022

Original Post Content:

I applied for new grad 2022 position in facebook and appeared for 45min phone interview.

Question 1: I was asked to find path from start(0,0) to end in the matrix avoiding the obstacles and appending the coordinates.
I found the approach to be recursion with backtracking.
e.g.
0 0 1
 1 0 1
 0 0 0

Coordinates are:- (0,0),(0,1),(1,1),(2,1),(2,2)
I could solve only one question. Got rejected!!

Comments