Google interview question

Asked me graph question about finding ancestors