ROUND 1 QUESTIONS
1. They asked me to implement Stack with
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?
- Amazon Interview Experience | Set 167 (SDE I for 1 year 6 months experience)
- Walmart Lab Interview Experience | Set 7 (Off-Campus 3 Years Experience)
- Walmart Lab Interview Experience | Set 8 (Off-Campus 3 Years Experience)
- Brocade Interview Experience | Set 2 (For Software Engineer 0-2.5 Years Experience)
- Amazon Interview Experience | Set 241 (1.5 years experience)
- Amazon Interview Experience | Set 242 (1 Year Experience)
- Amazon Interview Experience | Set 243 (2.5 Years Experience)
- Oyo Rooms Interview Experience | Set 3 (For Backend Engineer, Experience <=1yrs)
- Amazon Interview Experience | Set 248 (4.8 Yrs Experience for SDE II)
- Goldman Sachs Interview Experience | Set 23 (2+ years Experience for Java Developer Role)
- Amazon Interview Experience | Set 391 (SDE-2, 5.5 years Experience)
- Arcesium Interview Experience | Set 5 (3+ years experience - Developer profile)
- Oyo Rooms Interview Experience | Set 12 (4+ experience Backend Developer)
- Microsoft Interview Experience | Set 151 (SDE-2 3.5 years experience)
- Paytm Interview Experience | Set 21 (5+ Experience)
- Goldman Sachs Interview Experience | Set 39 (1.5 years experience)
- Microsoft Interview Experience | Set 169 (SDE 2 for 3.5 years experience)
- Salesforce Interview Experience - MTS | Set 4 (6.5 Years Experience)
- Medlife Interview Experience | Set 2 (1 Year Experience)
- Walmart Interview Experience for SDE2 | Set 19 (3.8 years experience)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.