View All num of num See all Photos Amazon.com This employer has taken extra steps to respond to reviews and provide job seekers with accurate company information, photos, and reviews. Interested for your company?Learn More. www.amazon.com www.amazon.com Work in HR? Unlock Free Profile Overview Reviews Salaries Interviews Jobs Photos Benefits 3.9k Reviews 11k Salaries 5.3k Interviews 11k Jobs Follow Add Review or Salary Follow Add Review or Salary Amazon.com 3945 Interview Question Software Development Engineer Intern Interview Las Vegas, NV Amazon.com Asked general computer science topics (Describe a hash table, etc.) Didn't ask any behavioral questions, or anything about my résumé. Had two coding questions: 1) Given a Binary Search Tree, print out the median value. If there is an even number of nodes, print the average of the two middles. 2) Given a Genealogy Tree, print out the tree, row by row. For example: Dave / \ Michael Sarah / \ / \ Joe Alex Sam Tom Output would be: Dave Michael Sarah Joe Alex Sam Tom The questions weren't very hard, but I nearly ran out of time because I couldn't understand them. I spent a lot of time just trying to understand what they were asking for. They asked about the time and space complexities of everything I was doing. After I finished the second question, he gave me another problem with it. Asked if there would be a way where you get stuck in an infinite loop, and how to fix it. Also, they allowed me to choose which language I was more comfortable with. I used Java. Tags: See more , See less 8 Answer Add Tags Flag as Inappropriate Thank you! Your feedback has been sent to the team and we'll look into it. Oops! We're sorry but your feedback didn't make it to the team. Your input is valuable to us — would you mind trying again? Send Answer Interview Answer 1 Answer ▲ 0 ▼ 1) Traverse through the tree, count the total number of nodes. Then, see if n is even or odd. If odd, use InOrder Traversal and go through n/2 + 1 times and return the data from that node. If even, use InOrder, grab the n/2 node data, then grab the n/2 + 1 node data, average the two, return the value.2) I used breadth first, with a queue. You would get an infinite loop if a child pointed to its parent (You keep enqueuing and dequeuing the same two nodes). To fix this, use a Hash Table to see if you've been to the node before (Put the Node itself as the key). Interview Candidate on 23-Mar-2013 Flag as Inappropriate Thank you! Your feedback has been sent to the team and we'll look into it. Oops! We're sorry but your feedback didn't make it to the team. Your input is valuable to us — would you mind trying again? Send Add Answers or Comments To comment on this, Sign In or Sign Up.