LinkedIn interview question

Graph question asking minimum distance between two nodes.