Meta Interview Question

Graph related problem.