Uber interview question

I was asked a graph based dsa question of medium leetcode difficulty on union find topic