How would you solve basic tree or graph traversal problems in an interview context at Amazon Services?