Pergunta de entrevista da empresa Viasat

Given an undirected graph, return how many components in this graph