- 0of 0 votes
Given a number (lets say 10 digit) - print all possible words that can be made from a phone pad. Remember that number n can vary. Also some numbers like 2 have ABC (only three alphabets) while 7 can have (PQRS) 4 alphabets. Your algorithm should acommodate all these.
(Kids do the above part - it is a classic programming interviews exposed question).
I used recursion to start with.
Space complexity is O(1) (not considering stack) - as we are just printing.
Worst case time complexity is (4^n). - all numbers are 7.
The trick question was - how much STACK space will recursive prog require? -- I bombed this trick ques. and got a reject.
Amazon on-site interview reject.
I interviewed with Amazon and had an on-site interview in Seattle. I was rejected and they did not move forward. The HR told me that keep applying and he forwarded my resume to the recruiter. They said you won't have to wait for interviewing with other teams - so please don't write-off Amazon from your list and keep looking.
Doesn't Amazon have a policy period where you have to wait for certain months to re-interview?
(On a side note: I really made some silly mistakes and wasn't careful of edge cases - so I wasn't terribly surprised that I didn't clear it. But I have learnt from my experience and I can be better prepared ahead in future)