Pergunta de entrevista da empresa Amazon

graph question, low level system design.