Viasat interview question

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