Pergunta de entrevista da empresa LiveRamp

How do you count the distance between two nodes in a graph when using BFS?