Block interview question

Related to graph theory