Wednesday, October 15, 2008

Amazon On Site round questions

1. Given an n, find the least significant non zero digit in n!, given that n! can go out of the number range. Example : if n=5, n!=120, return 2
Hint: what we need is (n!)%10 when we after removing all the 0's on the right side
and (xy)%10 = (x%10*y%10)%10

2. Design an editor

3. Given a,n find power(a,n)

Wednesday, October 08, 2008

Amazon Interview - second round

Hi,

I had my second round of phone interview on 8th October at 3:00PM. Questions were

1. Given an array A, how to circularly rotate the array for m times.
2. Given an array, it has elements first in increasing order then in decreasing order. How do you find the maximum element.
3. Given an array of characters A and a set S of characters, how do you remove the characters in the array A that are in the set S.
4. Write a function f(x,y) where x is the hours and y is the minutes, find the angle between the hours hand and minutes hand at the time x:y.