Oracle interview question

Graph Data structure question and Java 8 basics