Pregunta de entrevista de Oracle

Graph Data structure question and Java 8 basics