Amazon Interview Experience | Set 152
Amazon written round – Time 1 hour.
1. Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest continuous sequence of 1s.
Eg: Array- 1,1,0,0,1,0,1,1,1,0,1,1,1 Output - index 9 Assuming array index starts from 0.
2. Given an unsorted array, find the k smallest elements
Array {9, 5, 1, 4, 13, 6}
k = 3
Output: 1, 4, 5
3. Find the minimum distance between any 2 given nodes in a tree.

Minimum distance between 2 and 11 is 3
2–>5–>6–>11
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.
Recommended Posts:
- Amazon Interview Experience | Set 167 (SDE I for 1 year 6 months experience)
- Amazon Interview Experience | Set 391 (SDE-2, 5.5 years Experience)
- Amazon Interview Experience | 401 (3+Years Experience for SDE II)
- Amazon Interview Experience | Set 243 (2.5 Years Experience)
- Amazon Interview Experience | Set 242 (1 Year Experience)
- Amazon Interview Experience | Set 241 (1.5 years experience)
- Amazon Interview Experience | Set 248 (4.8 Yrs Experience for SDE II)
- Amazon Interview Experience
- Amazon Interview Experience | Set 250
- Amazon Interview Experience SDE 1
- Amazon Interview Experience | 262
- Amazon Interview Experience | Set 429 (For SDE 2)
- Amazon Interview experience | Set 335
- Amazon Interview experience | Set 330
- Amazon Interview experience | Set 328 (For SDE-1)



