Placement Papers - Infosys

Infosys Technologies Ltd.
Infosys Interview Experience - Mumbai 03/08/2016
Posted by :
Amit Banda
(75)
Infosys aptitude test for Specialist programmer.

Coding questions: 2.
Duration: 90 minutes.
Language: Any.

1. A cumulative set starting from P integer is to be check whether possible.

E.g {4,6,8,11} and number 5. A cumumlative set is possible as 5, 4, 6, 8, 11, Where the number of x position, its value must be less than previous elements. So here 4 is less that 5, 6 is less than (5+4) and so on.

Another example is (6, 8, 11). here cumulative set is not possible. Return the number of moves for the set by adding, removing, element from the set so to make cumulative.

Testcase1:
input: 5#4,6,8,11
output: 0
Testcase2:
input: 5#6,8,11
output: 1

2. A database of long URL is maintained. From the short URL index is formed which point to the long URL.

Example: Let take e=2, a=1, t=0..... then for short URL \'eat\' index is = e*3^2 + a*3^1 + t*3^0 = 21.
Short URL can be string of any alpha number character and base is not 1.

Now the database reference to long URL is lost. you need to return a minimum index that is possible with base not equal to 1.

Testcase1:
input: 11001 output: 25
Testcase2:
input: cats output: 75