Amazon Interview Report
- 0of 0 votes
AnswersGiven two node values for a tree, find LCA. Consider edge cases - (1) If there exists only one value in the tree, return null. (2) If none of the values exist in the tree, return null. (2) Handle ancestors for duplicate values like -
- eyeonu.imtiyaz November 01, 2012 in United States
20
/ \
10 50
/ \ / \
10 17 40 60
/ \
5 15
So for above tree if values 5 and 17 are given, there LCA is the upper 10 and not the lower. You can exemplify something I bet :-)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersI will try to state the question. We all know mobile phone's keypad where "2" is mapped to ABC, "3" to DEF and so on. Given any sequence of integers, find all the (matching) combinations in your phone book.
- eyeonu.imtiyaz November 01, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven a sorted array of size n implemented as ring buffer, so that when array has reached (n-1) index, it will be overwritten from 0th index and likewise it will continue. Given any number, find its index in the array in less than linear time. Interviewer asked to consider the edge cases which I could not quite understand during the interview. I told, the edge cases would be no-element array, array with one element and such.
- eyeonu.imtiyaz November 01, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer