Tip 1 : Solve all the question with Microsoft, Amazon tags
Tip 2 : Never give up during the interview, rather just keep trying whether you reach the solution or not.
Tip 3 : Be confident, this is the most important requirement.
Tip 1 : Claim the things, that you have done in actual by your own.
Tip 2 : Never write any false information on the resume, always get it verified with your mates.
In this round, there were 4 sections of MCQs, along with two coding questions. It lasted for 2.5 hours in which the camera was on along with the microphone on the platform AMCAT. One coding question was of hard difficulty level of graph and another was of medium level difficulty question of dynamic programming. MCQ part was quite easy with a timer, on each sub part and can be easily solved.
Marked Nodes are Circled with red colour.
Now consider this example of the graph. Here nodes 1,2, and 4 are marked, and let us take the value of K as 3, i.e., we have to find all the nodes at a distance less than 3 from all the marked nodes. We can see that nodes with index 5,9,8,2,0,7 have distances less than 3 from all marked nodes; therefore, the total count of nodes will be 6.
Step1 : I solved this problem using breadth first search.
Step 2 : Main thing to observe in this problem is that if we find two marked nodes which are at largest distance from each other considering all pairs of marked nodes then if a node is at a distance less than K from both of these two nodes then it will be at a distance less than K from all the marked nodes because these two nodes represents the extreme limit of all marked nodes, if a node lies in this limit then it will be at a distance less than K from all marked nodes otherwise not.
Step 3 : then I coded the solution, and it ran successfully all the test cases.
1. Firstly, I coded the problem using recursion, but I got TLE after submission.
2. Then, I optimized, using dynamic programming, but the time I could submit the code, the time was up, and I was not able to submit.
There were around 40 people shortlisted after round 1, for the interview, round, in the morning PPT was held, after which the interviews were scheduled, for 30 minutes till 6 pm in the evening,
my interview was at 4.30 pm
Interviewer was straight forward, and direct in approach, and did not waste even a single second of his or mine. Sharp after 30 minutes the interview was ended.
through out the interview, he was friendly, and just observing.
Firstly, 3 coding questions, were asked, then 2 concepts of java and 1 concept of data structures was asked.
the question related to java were, demon thread and platform independence. In data structures, I was asked to give brief intro regarding the AVL trees.
Input: 'n' = 7, 'x' = 3
'arr' = [1, 1, 1, 2, 2, 3, 3]
Output: 2
Explanation: Total occurrences of '3' in the array 'arr' is 2.
1. I started with linear search
2. Then when I said Binary search, I was asked to write pseudo code and explain it.
3. I covered all the test cases, including the corner cases.
Merge Sort Algorithm -
Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.
The above illustrates shows how merge sort works.
It is compulsory to use the ‘Merge Sort’ algorithm.
1. I was asked to directly code the solution.
2. I followed the same, and coded, it, in between the interviewer stopped me and said, I got you, lets move to next question.
3. I followed this approach, divided the input array into two halves, calls itself for the two halves, and then merge the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is a key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.
getSize: Returns an integer. Gets the current size of the stack
isEmpty: Returns a boolean. Gets whether the stack is empty
push: Returns nothing. Accepts an integer. Puts that integer at the top of the stack
pop: Returns nothing. Removes the top element of the stack. It does nothing if the stack is empty.
getTop: Returns an integer. Gets the top element of the stack. Returns -1 if the stack is empty
1. Firstly, I made the structure of linked list.
2. Then, I made the four functions, of stack pop, push, empty and full.
3. And when I started to explain the written code, the interviewer was well convinced, and said no need, I understood, it and moved to theory questions of java.
The interview was scheduled at 4.30 pm again, and due to network issue, my audio was not clear to the interviewer, but the interviewer was highly cooperating, he called me over phone to take the interview, and video was on through the zoom meet only.
The interview was like a discussion from both ends, which went very satisfying for me as a candidate and the interviewer too.
Before the interview in the morning, we were given the topics on which we had to write 100 words.
Tip 1 : Be honest
Tip 2 : Treat the HR interviewer as your friend.
Tip 3 : Never speak anything, falsely just to create impression.
Tip 1 : Try to cover all the points from name to all the professional achievements.
Tip 2 : Try to include your hobbies too.
Tip 3 : Always mention your goals
Tip 1 : Always take your time, to analyze what the interviewer is actually asking, never run into and spoil the things.
Tip 2 : In this question, the interview wanted to know my future goals, answer it in a way that shows that job is important for you.
Tip 3 : Take stand for your statement, and try to relate it with stories.
Tip 1 : These questions should not be answered quickly with false guesses.
Tip 2 : Analyze in your mind whatever comes, like there are 5 trees in these regions, and there are total of 10 areas containing trees in college, and reach the solution.
Tip 3: Whatever strategy you have followed, put it forward to the interviewer, explaining everything.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?