Got contacted by recuiter from Amazon through phone. Since I don't take calls from numbers I don't recognize, he left me a voice message and also sent me an email. He said he found my resume on Dice.com.
I replied him back with some questions, and available times.
He scheduled a phone interview next day for following Monday.
Interviewer called me 10 minutes late.
His native language was not English and he was on a speakerphone, so I had a hard time understanding him.
But I was able to understand him once he started talking on the phone not through the speakphone.
There was not overview of what he's doing just straight to the first question. Asking me about my experiences in software engineering. Asked me if I am proficient with Java, then asked me if I am familiar with C++.
Then asked me about Java keywords final, finalize, and finally. I couldn't remember what finalize was, and he briefly explained me then I could remember it was for garbage collection. I told him its relationship with the garbage collection, then he asked me to explain how Java does garbage collection. After my explanation (mentioning Mark&Sweep among them), he ask me if I know how Mark&Sweep is implemented. I know what it was but didn't know how it's implemented (extra bit, traversing from each "roots"), I just told him I do not know.
Two coding questions followed.
Given array of integers, how do you find the first pair that adds up to 10.
I asked if the array contains negative numbers, and he said yes.
Solved the problem using HashMap, then he asked me the second coding question.
Given array of integers represending historic stock prices sorted in order of date (first one is the earliest price and the last is the latest price.) If you can trade only one stock, you can only buy once and sell once, and can hold the stock maximum 30 days, how would you find the buying and selling point that maximize the profit.
I tried to clearify some points buy asking if each number represent closing price.
I couldn't solve it, and he dumbed it down to following question.
You have an array of 30 integers representing the historic stock price sorted by date.
How would you find the buying and selling point that maximize the profit?
I paniced that I screwed up the interview, and couldn't think of anything better than O(n^2) brute force solution.
He asked me to send him the answer through email.
I asked what kind of software development environment they use (RAD, eclipse, emacs, etc.),
and if he enjoys working for the company.
He was pretty honest about what he likes and doesn't like about the company.
After the interview was over, I tried to solve the problem with better algorithm which I couldn't find.
I ended up sending something stupid, tried to go to bed (which I couldn't) and sent the brute force one too.
Next day, I was able to solve the problem, and sent him the solution.
It's been 4 days and I'm still waiting to hear back from them.