GFG App
Open App
Browser
Continue

# LinkedIn Interview Experience | Set 4 (On-Campus)

ONLINE ROUND:
3 coding Questions in 1 hour :
1) Given a binary search tree and a key, if found return 1 else -1.
2) Given a string find the number of distinct substrings (should optimise time and space complexity)
3) Given a string finf the number of distinct palindromic substrings(should optimise time complexity)

INTERVIEW ROUNDS:

Interview 1:
1) Given a boolean expression find the number of ways to paranthasise it so that it evaluates to true
2) Optimal Strategy for a Game
3) Given n stairs , you climb 1 , 2 or 3 stairs at a time . Find the number of ways to reach the nth step
Interview 2:
1) Given the pointer to the root of the tree and two values val1 and val2 . Find the length of path between the values val1 and val2 in the binary tree. { handle corner cases where both the values are on the same path}

``` eg: a - 21 b - 2 c - 54 d - 5 e -4 f-1
2154
1) ac
3) bfc
4) bfde
4 ways to decode ```
```   0 0 1 0 1
0 1 1 0 1
0 0 0 1 1
0 0 1 1 0 ```

The above matrix has 2 components
constraints: Time complexity O(N) space complexity O(1)

2) Given a tree check if it is a binary search tree or not constraints: space complexity O(1)

Interview 4: (HR+Technical)

1) Asked questions on my resume and challenges faced in my project
2) Showed me wwww.amazon.com page and asked me how to design the backend database so that it supports functions like displaying entire information about a product , its average rating and number of customers who gave each rating etc.

Overall the experience was good and the interviewers were friendly. I would like to thank geeksforgeeks.org which helped me throughout my preparation.

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

My Personal Notes arrow_drop_up