GeeksforGeeks App
Open App
Browser
Continue

# Amazon Interview Experience | Set 257 (Off-Campus)

I was recently interviewed by Amazon, Bangalore for SDE position. It was an off campus drive in Delhi for TRMS team.

Round 1 (F2F):
Q1) In a sorted array every number is present twice, only one number is present one time. You have to find the number occurring once. Expected complexity : O(log N)
Ex : 101, 101, 200, 200, 301, 450, 450
Output : 301
Q2) Clone a binary tree with random pointers.
In both the questions, they needed a proper working code covering every edge cases.

Round 2 (F2F):
Q1) Next greater element.
Q2) You have been given a grid with some doors, walls and some empty spaces.
1st part : You have to tell the least no of moves to go from random position in the grid to the nearest door. You can move in four directions only, i.e, left, right, above, below.

2nd part : Least distance of every empty cell to the nearest door. Lots of discussion was done on both the parts of the problem.
I spend some time and finally came up with the working solution using Breadth first traversal.
Q3) Find Excel column name from a given column number.
This was the toughest round.
The interviewers had their flight to Bangalore and were getting late. So, next two rounds were telephonic.

Round 3 (Telephonic) :
This round was taken by hiring manager.
Q1) Tell me about yourself. Your current company, your role and responsibilities. Reason for leaving current company.
Q2) A 100 coin puzzle.
Q3) What happens after you write “a.out” and press enter. He wanted to know the functionality performed by the OS after executable file is created of your code.
Q4) What happens when your code encounters NULL?
Q5) Garbage collector in Java. How is it different ?

Round 4 (Telephonic) :