Wednesday, March 24, 2010

Second Phone Interview - Amazon

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.

Thursday, March 18, 2010

First Phone Interview - Amazon

My First Phone Interview With Amazon

I never expected to get a call from Amazon ,through Dice. Though I was so happy to hear that I was shortlisted for interview. I scheduled the interview on Wednesday , so that I get enough time to prepare.And I went to Sea World - San Antonio on weekend.

First step, to prepare, I googled 'Amazon Interview Questions'.... and whoaaaaah, many many results. I went through lot of websites, blogs(one of them inspired me to write this blog ;) ) . It always helps to have an idea about the interview beforehand. I came across a blog , where I found information about the book 'Programming Interviews Exposed' and strightaway thought of having it. Now, being an Indian Software Techie , I thought of having it, not buying it. Logged on to www.filecrop.com and downloaded the book for free. I wish, this habit wouldn't have been there in my blood. Nevertheless, I am proud of it.

On Wednesday, I got a call from them; they were pretty much on time. 'She' (Qin Chen) was a Software Development Engineer at Amazon for two years. Started with asking me ,Why Amazon? Luckily , my girlfriend had told me that Amazon was listed amongst three Dream Companies , in Forbes magazine last week, so mentioned that. Then she asked some questions on resume, my previous work experience and then asked me to explain one of my projects. I think I did that well.

Then She asked me some programming questions on java. What is difference between Final, Finally and Finallize? What is difference between == and equals? Primitive types in Java? I answered them satisfactorily. Here comes the hard part, she gave me a series( A, B , C, D, E... Z, AA, AB...AZ... BA, BB,......). I couldn't understand the series for 5 mins and she went on explaining. I must mention that she was really cool and dint give up until I understood. To make it straight, she asked me to open excel sheet. The column names in excel sheet represent that list. Task was to return n th string in the series. Once I understood the series, I was able to pseudo code within a minute. She told me that your approach is correct , but code and send it to me( I did it after my interview).

Then she asked me to design an Object Oriented Model for a Movie Theater. The purpose was to return nearby theaters, given zip code and movie name. I was able to to design two classes and explain her. I think she was convinced with what I explained. I would like to advise you all , to prepare OO designs for real world objects beforehand(For eg. Cards, Elevator, Parking lot)

Finally, She asked me whether I have any questions. I asked two three questions, one of them being " How good is Amazon to start career with?" . I think , the interview went well, but I did bad at some things. Keeping my fingers crossed, I am hoping for best. I will keep posting as soon as I make any progress.