Amazon interview question

Was asked to implement some graph search function based on an existing code base on the spot.