Sunteți pe pagina 1din 2

Amazon Experience - 18 jan 2011 Total 4 Tech rounds Round1 1) Find the length of loop in a link list.

2) A array was initially sorted and now its rotated cyclically k number of times. How we will search an element in it? 3) LCA of BST ( i accidently listened Binary tree & started explaining for it .. Took a long time for him to understand.) 4) Huffman code? How to generate? 5) An array is given it has some values a) only positive values and 0 value. This value denotes the number of steps it can take from that position like 1 3 1 2 4 so from (3) node we can take AT MAX 3 steps..we can take even less also. so basically a[i] + i is the max reachable postion from that position. WE have to find out whether we reach the end of the array or not. b) now -ve numbers can also be present. That we show the max number of steps it can take in the -ve direction. We have to find out the max possible reachable index. For every question he asked me to write a code. Round2 1) (n&n-1 == 0) what does it do? 2) In an M * N array if suppose an element is 0 so we want to convert that row and that whole column into 0; 3) You are a lift builder . There is a 75 storey building. a) How many lifts we will use. (I think it was more sought of guess estimate question. We have to take appropriate factors of designing lift system into account). b) What will be the floor numbers put in every lift. Long discussion on the lift problem. Too many specfications he started putting. He was like i was expecting these i was expecting that. 4) In every team or project only few ppl r able to excel or only few ppl can be more trustworthy than the others. What will you do to become more trustworthy.?

Round31) Do you know threads? a) Uses , limitations of thread b) How to synchronize. ( I said few things related to Pthreads) c) Something related to kernel level and user level thread came into discussion. d ) What are they used for? e) How to schedule Threads. ( Priority is given)

All these questions were a part of my answer so he kept questioning in watever i answered.(Be clear with the words you say . They will counter ) 2) Insert , delete , upadte anomalies. How will you improve it ? ( I couldnt answer this questions properly). 3) Reverse a link list in a groupsize- of 2. like E.g 1 --> 2 --> 3 --> 4 2 --> 1 -->4 --> 3 Take in account the odd length as that is the error he pointed in my code. Round-4 1) Write a function in which two string are passsed. We have to find out if the two strings are rotationally equivalaent( One string is roated cyclically x number iof times) or not? 2) Given a list or words like in a dicationary. They are arranged in a lexcicographically order. We have to find out the new ordering between the characters. Any posible order. E.g BCG AGI AEF AFR Ordering B<A G<E<R BA GER or even GER BA will satisfy as their is no mutual ordering betwen these two. (Proposed many solution nearly all of them in the test cases he gave . This question took atleast 45 mins ) 3) He said he was running out of time so 2 quick questions a) What is ACID Properties in database. b) Why we do normalization?

S-ar putea să vă placă și