I applied through a staffing agency. The process took 1 day. I interviewed at Pickyourtrail (Chennai) in Feb 2019
Interview
The interview was dead easy.
First round
--------------
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 down 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?
5. She came out and said I was rejected and she asked me to leave. I asked for the feedback and then she went inside and asked some dev (I came to know that, now only they were actually validating/looking at the paper where I wrote code).
6. Seriously Why would you do that? If salary is the problem, why the hell would you ask me to attend the interview.
7. I seriously don't want to write the questions they asked for the way they behaved(see point no. 4). Still, It might be helpful for future candidates who prepare for other companies other than PickYourTrail.
8. One Word - PICK YOUR TRAIL IS VERY BAD! Do not join.
Also, The culture is very bad. As I was awaiting result of 1st round, Some guy working there was shouting at his direct reportee for some mistake in front of everyone.
Self doubt I am having now -> What? Seriously Did I attend interview in an IT company?
Interview questions [1]
Question 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).
Because,
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.
Constraints,.
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.