Meta interview question

Graph related problem.