Interview Experience Amazon for AWS Team(Telephonic)

Postion Applied for: Amazon SDE-2

Interview started with Introduction and discussion about projects and technology stack on which I worked on followed by 1 Question only followed by complexity of solution.
**Given a String with numbers only return a integer array without shuffling element such that array elements form a fibonaci series(Sum of Last 2 elements equals to 3rd element other wise a new array with -1 as only element.
For example :
**
Example 1:
Input: 1235
Output {1,2,3,5}

Example 2:
Input:11112233
Output: {11,11,22,33}

Example 3:
Input: 123456579
Output {123,456,579}

Example 4:
Input: 135
Output {-1}

Comments (6)