Google interview question

List all function dependencies and detect if there is any cyclic