Related Articles

# Amazon Interview Experience | Set 156 (On-Campus)

• Last Updated : 09 Aug, 2019

Written Round:
There were 21 MCQs and 2 coding questions hosted on hackkerank.
Time: 1 hr 30 mns.
The MCQs were from c, c++, os, networks for example
1. LDAP stands for?
2. 2^30+2^30+2^30+2^30 =?
3. Given three process P, Q, R . P requests resources A, B, C, Q requests B, C, D and R requests C, D, A which of the following orders is deadlock-free
4. Given a postfix expression find the value of expression
5. Which of the following is the inorder traversal for the given preorder traversal
6 Question-based on the precedence order of operators

Coding questions:
1) Given a graph. Find if a cycle exists and print the nodes in the cycle. If multiple cycles exists print the cycle starting from the lowest index

2) Given a string S and a string T, count the number of distinct subsequences of T in S.
S = “rabbbit”, T = “rabbit”
3

Interview 1:
1) Find the diameter in given tree which can start at any node and can end
at any node and should have only single turn.

```         10
/   \
5    8
5-10-8 has two turns
10
/  \
45   56
/ \    \
10  20   45 ```

10-45-10-56-45 has 1 turn
20-45-10-56 has 2 turns

Interview 2:
1) Word Break Problem
2) Find if an array of strings can be chained to form a circle
3) What datastructure will you use for designing lift
4) Efficient data structure for minimsing the following operations if we have an array arr[0 . . . n-1].
a) Add a value x to array from index l to r where 0 <= l <= r <= n-1
b) Find the value of a specified element of the array arr[i] where 0 <= i <= n-1.

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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon. GoogleE-Litmus and Microsoft Test Serieses.

My Personal Notes arrow_drop_up