Guidewire interview question

Asked to implement recursive search for graphs