Showing posts with label Amazon Interview Question. Show all posts
Showing posts with label Amazon Interview Question. Show all posts

Wednesday, July 25, 2012

Amazon Interview Question 2

 write the code ofTwo large numbers ( their integer limits are very large which has not in the integers range) , so give the output of adding the two large numbers?
Example;
str1 ="1111111111111111111111111111111111111111"
 str2 ="22222222222222222222222222222222222222222"
stmstr = "33333333333333333333333333333333333333333"

Amazon Interview Question 1

10 000 integer numbers in an array, Each number is 10 bit. Sort the array

10 bit means there's only 2^10 = 1024 possible values. Use counting sort. Create an array of 1024 integers and in the i-th index keep the number of occurrences of the i-th possibility. IN the end, just traverse your occurrence count array printing each element the number of times that it occurs.