Well well well ! I don't know which algorithm they use for evaluating candidates , but certainly < O(log n)( that means faster). I mean, I got a call for 2nd phone interview on Friday. I had little expectations, but Amazon is quick. So I set up the interview on Wednesday(again !). But as usual , I did not study ( at all) on weekends.
I have always heard that Amazon interviews get tougher as you proceed. Especially the 2nd phone interview is really a hurdle. This time I decided to prepare really hard(eventually , as expected, it did not happen). Again went through lot of blogs , web sites. One of my friend asked to me read book 'Programming Pearls'. Again same process. Downloaded it from www.filecrop.com . I did not find it very useful though. I chose to refer Programming Interviews Exposed, Complete Reference Java 2 and Art of Computer Programming - Sorting and Searching by Donald Knuth.(My ebook reading speed is really good by the way ;) )
On Wednesday , I got a call from them; this time they were 9 minutes late. Rare ! Hilton Campbell was on the phone. I expected a voice of lady, but it was 'he'. He is a Software Developer Engineer at Amazon for past two years. Anyway, first, he asked to explain my best project. Once again, I explained the same project which I explained in 1st interview(Rule Based Stock Trading System C++).
Then he asked to write a function for nth Fibonacci series. I wrote the recursive functions in 2-3 minutes. Then he asked me if there is any error and complexity. I corrected one error when input is negative. Honestly, I did not know the complexity of Fibonacci series. So I said its constant. But he gave me some hints, with which I could answer correctly. Then he asked me write non recursive logic. I wrote that too, with some hick-ups. I should have studied Fibonacci more carefully. It was a worst start I could ever imagine.
Then he asked me What is polymorphism. I explained it very well with examples of function overloading and function over-riding. He was satisfied with the answer. Then he asked me design object oriented design for Car. Well I designed classes like Engine, Tyre, Transmission, Parts , Car. Also mentioned the member variables and methods for each class and their relationship. Then he asked for more functions. I revised the design as per his requirement. Again, he was quite pleased with the answer. They just see your approach.
Next, he asked question on files(Unix). There are 50,000 html files. Some might contain phone numbers in different formats. List all the files that contain phone numbers. I knew the answer already, I acted like I did not know. I said I would use command grep with regular expression for phone numbers for *.html . Again , it was correct answer. I told him that , I dont exactly know the syntax of command, so he asked me how would you find it?. I answered that I would use 'man' grep. Then he asked me some more unix commands(which I already knew ;)).
Next, he asked to describe hash tables. I explained the hash table with an example of function %8(mod 8) for 8 element hash table. Then he asked me about various complexities of hash table and I was able to answer them.
Then , he asked to write a function to return whether the number is power of 2 or not. Again , I knew it already. But, I took 1 min to write the function and explained it. He asked me whether I already knew the problem. So I said no, but I had observed the bit pattern of power of two and a number 1 less than it. Using that pattern we could solve the problem.
Finally, he asked me if I have any questions. I asked him couple of questions like, What do you do at Amazon? How much exposure is provided to SDE at Amazon? etc. It was supposed to be 1 hour long interview, but got over in 38 minutes.The interview went well, but I really screwed it up with the simple Fibonacci problem. Keeping my fingers crossed, I am hoping for best. I will keep posting as soon as I make any progress.