Pickyourtrail Interview Experience (SET 1)

1. They asked me to implement Stack with
a). Push,
b). Pop
c). add K to bottom e elements
I don’t want to use in-built Stack that Java provides. Hence I wrote a class Stack and defined the functionalities for each of the above operations.
I used an array here to maintain stack. Basically it’s a Stack using Array.
For a). TC – O(1). Just add to the current free position (top) in the array and increment top.
b). TC – O(1). Decrement top and remove the element.
c). TC – O(e). Iterate bottom e elements (from 0 -> e) and increment by K.
2. Given n integers and value k, print total number of pairs such that,
for all pairs -> (a, b)
a) a < b
b) a + k == b
c) (a, b) should be unique.
For eq., for integers 1 1 2 2 2 and k = 1
You can have only 1 pair = (1, 2).
a). 1 < 2
b). 1 + k (1) == 2
I used Set to eliminate duplicates and gave the answer in <= O(n) solution.
Basically the tc is O(non-duplicates)
3. Given N integers (which contains duplicates ) in an array, make the array unique.
1. You can only increment the values and you cannot decrement.
2. Make array unique in minimal number of increments such that the sum of total elements in the array has to be minimum.
The interview was dead easy.

First round feedback

1. They gave me 3 programming questions and asked me to write code in a paper for all of them. I used Java programming language. I have mentioned the questions above here.
2. I gave efficient solutions for all the three in terms of TC and space complexity etc.. Basically for all those questions, you cannot optimize further.
3. Then they were discussing about the first round in a meeting room which was near me and I was able to overhear what they were discussing.
4. They were like, since this guy is from Amazon, they could not meet the salary requirements and hence they finalized to reject me. Seriously WHAT?

Self doubt I am having now -> What? Seriously Did I attend interview in an IT company?

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 :

Be the First to upvote.

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