Facebook Interview Question for SDE-2s
- -2of 8 votes
As we know facebook always asks questions from graph theory he asked me this problem to code-- Rahul Sharma October 12, 2013 in India
there is a grid of n*n where each cell represent an Island or and some of these are very dangerous so u have to avoid these during path selections.You can move up,down,left ,right.You are given your starting position ,positions of dangerous Islands and position some specific Islands.Your task is to deliver a message to all the specific Islands in minimum number of moves to all specific Islands(NOTE- there are also chances that no moves are possible to cover all specific Island ,in such case you have to tell "NOT POSSIBLE TO DELIVER ALL ",otherwise output minimum moves).
| Report Duplicate | Flag | PURGE
Facebook SDE-2 Algorithm