Amazon Interview Question for Software Developers
- 1of 1 vote
down vote- anony January 08, 2017 in India
Consider the following series:
A := 1
B := A*2 + 2
C := B*2 + 3 and so on...
Write a program that:
-outputs the number corresponding to a given letter;
-given a string of letters like 'GREP', computes the sum of the numbers corresponding to all the letters in the string (i.e., G + R + E + P), as given by the above series; and
-given a large number (that would fit into a standard 32-bit integer), finds the shortest string of letters corresponding to it. You may use a greedy approach for the last part. Compute the values of the numbers corresponding to letters as and when required and DO NOT pre-compute beforehand and store them in a data structure.
| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm
Interview Type: In-Person
Open Chat in New Window