scorpionking
BAN USER- 2of 2 votes
AnswersWhy Amazon?
- scorpionking in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Behavioral - 0of 0 votes
AnswersWhich data structure would you use for optimum addition removal, querying and priority.
- scorpionking in United States
(Heap, Hash and BST were rejected )
ok after finishing the interview, he finally told me the answer: he said that with each node we must store the min and max child.
his opinion was: Hash has good insert query complexity, but bad priority wise retrieval.
BST has logn for all the operations
Heap just ensures that the top priority is at the top (not the next order)
no wonder i got a reject :P| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven a tree, link all the siblings from right to left.
- scorpionking in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersFind the first occurance of a number in a sorted array.
- scorpionking in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures
good stuff esp the geeks for geeks site
i found this very informative
ardendertat .c om/2012/01/09/programming-interview-questions/
this is close to what the interviewer was hinting on...
btw do u know any book for trees and different type of trees and problems on trees?
thanks a lot for the honest feedback... i am really thinking back on what went wrong :)
I feel that the reason I got rejected is because my second round of interview was 2 questions and i could not answer both of them ... that was the final straw :(
the first one was quite straight forward
its 5 yrs of full dev experience.. (i mean no team leadership/ mgmt)
- scorpionking September 19, 2012ahh i see.... why dont u come up onthe chat box here ... we could sync up to share stuff which i already collected
- scorpionking September 18, 2012sid rane you seem to be serious on coding :)
btw i had suggested this approach but the interviewer asked me to not use a queue.
he asked me to solve it without the space requirement of an additional queue
well what i mean is that interviwer was satisfied with my ans, but as i did not get through i dont know if there exists something better.
- scorpionking September 18, 2012Your code is similar to what i had answered. I guess its close to the being correct (not checking NPE and corner cases)
- scorpionking September 18, 2012I did NOT
(cos i did not get through hehe )
yes. level by level
- scorpionking September 18, 2012
Repmartinskrull, Analyst at A9
Hi everyone, I am from new york,USA. I currently work in the Affiliate Marketing industry. I love all things ...
Reppaulaamontalvo, AT&T Customer service email at AMD
I am working as Human Resources Associates, and my duties are for obtaining, recording, and interpreting human resources information within ...
hmm OK after a long list of offensive comments which tried to justify my rejection, let me try to explain again:
- scorpionking September 21, 20121. It was an open ended question at the end, He was not having a special case..
He precisely asked me this:
I want a data structure which gives me efficient lookup, insert and querying by priority (i want the second biggest element, 5th biggest,etc)
He also mentioned that I am free to use my creativity and not limit to the standard data strucutres.
First i said hash, he said hash will not give efficient priority lookup
Then i said linked Hash, which too he rejected
BST also rejected.
Then i suggested Heap. He said heap will just give efficient lookup for the most prioritized node, not the 2nd most or 5th most
My issue was I did not read abt anything else than the basic data-structures.
He hinted that I could solve it using changes to basic BST. And the time was up, he was in hurry to leave for home as my interview was the last.
After calling off, he told me the solution which is the same as cksharma.skt suggested and only he could solve properly in this forum :)
My advise for other interviewees would be to atleast read a one liner about datastructures other than the basic ones.