Cruise interview question

Find a connected component in a binary image given a starting index.