Pregunta de entrevista de Dematic

A graph question. No coding just thought process