Cloudera interview question

Graph problem