Amazon Interview Report
- 0of 0 votes
Answersconsider any string of characters
- richa.shrma.iitd April 18, 2012 in United States
aabbbccdeef
break it into partitions such that each partition is a palindrome
aa|bbb|cc|d|ee|f so 6 partitions| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersconsider binary representation of all numbers
- richa.shrma.iitd April 18, 2012 in United States
1 : 1
2 : 10
3 : 11
.
.
.
7 : 1 1 1
...
how many ones are requred to write numbers from 1 to n.
eg how many 1's are needed to write numbers from 1 to 7 : 12
expected complexity : logn| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersprint all palindromes of size k possible from given alphabet set.
- richa.shrma.iitd April 18, 2012 in United States
eg alphabet set : {a,e,i,o,u}
print all palindromes of size say 10.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answerspow(a,b) = a*a*a ...*a (b times)
- richa.shrma.iitd April 18, 2012 in United States
consider pow(2,i)*pow(3,j) * pow(5,k)
where i,j,k are whole numbers.
so the possible numbers that can be written in this format are
1,2,3,4,5,6,8,9,10 ....
quesiton was to print nth number in this series (say 100th)
expected complexity : O(n).| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a number. And one permutation of that number. Find out in how many steps can you get back to the original number from the permutation if you use the same mapping again and again. If its not possible, then state so.
- richa.shrma.iitd April 18, 2012 in United States
Example: 2315 -> 5213
So in this example Mapping is number at 1st index -> 2nd index
2nd index -> 4th index
3rd index -> 3rd index
4th index -> 1st index
So using same mapping can we come back to 2315. If yes then in how many steps?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven X different vectors. Find the combined median in an efficient way
- richa.shrma.iitd April 18, 2012 in United States
Discuss both when they are sorted and not sorted| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a string. Tell its rank among all its permutations sorted lexicographically
- richa.shrma.iitd April 18, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm