# Google Summer Trainee Engineering Program(STEP) Interview Experience

Telephonic Interview 1. (Telephonic + Google Docs Shared)

Q1. Given an array of integers, you need to find the local maxima.

```Example : [1 3 5 4 7 10 6]

Output: 5 or 10

Explanation: Any of the local maxima can be the output.
Here 5 is greater than 3 and 4, 10 is greater than 7 and 6.
```

```Example : ({[][]})

Output: Valid

Explanation: Every opening bracket has a closing bracket.

Example: ({[]]})

Output: Invalid

Explanation : Every opening bracket does not have a closing bracket.
```

Telephonic Interview 2. (Telephonic + Google Docs Shared)

Q1. There are 2 arrays. Smaller is of size m and has m elements in sorted order. The bigger array is
of size m+n, where there are only n elements in initial n positions in sorted order. So, last m
positions are empty in the bigger array. Insert smaller array’s m elements in m + n array has all numbers in sorted order.

```Example :
Input Array    N[]={5, 9, 15, 20,,,,,, }  n=4
M[]={1, 3, 6, 8, 19, 35}  m=6
Output array   N[]={1, 3, 5, 6, 8, 9, 15, 19, 20, 35}
```

Q2. Given a binary tree with integer values, find the sub-path with the maximum value in it

```
Example :
1
/   \
2      3
/   \  /   \
4     5 6    7

Output : Max path is 5, 2, 1, 3, 7
Explanation : 5+2+1+3+7=18 is the maximum value that can spanned.

-100
/     \
2        3
/  \     /  \
4    5   6    7

Output : Max path is 6, 3, 7
Explanation : 6+3+7=16 is the maximum value that can spanned.
```

Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.