Tip 1 : Participate in live contests on websites like Codechef, Codeforces, etc as much as possible.
Tip 2 : Practice previous interview questions from LeetCode, GeeksForGeeks.
Tip 3 : Revise Computer Science subjects like DBMS, OOPS thoroughly.
Only write those things in the resume which you are confident of and keep practicing.
This is a written round on paper for everyone. Three coding questions were given. Two out of three must be correct covering every single edge case to qualify for the next round. Only the most optimal solution was to be considered.
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]
Output: 11
Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
I used the Kadane algorithm to solve this question and wrote a clean code with which could work on negative numbers also.
I solved this question using a priority queue(max heap) by inserting all elements in the priority queue and then taking the maximum two out of them and pushing their sum again to the priority queue.
If the input tree is as depicted in the picture:
The Left View of the tree will be: 2 35 2
This was again a very standard question and solved it using recursion.
This was face to face interview round.
For the given binary tree and X = 9
{1, 3, 6} is a valid triplet because 6 is a node whose parent is 3 and grand-parent is 1. Also, the sum of these nodes is 1 + 3 + 6 = 10 which is strictly greater than X = 9.
I thought of recursive preorder traversal and then tried storing elements in a stack but could not solve this question. Then the interviewer moved to the next question.
I told the interviewer dynamic programming based solution on either including the current element to current sum or excluding the current element and then he asked me to write its code and I gave properly commented code for this.
This was face to face interview round.
Tell me about yourself.
I gave him my basic introduction with previous experience and skills.
Why are you looking for a change? You recently joined a company and now again you are giving interviews?
I simply gave the reason that amazon is better than my previous company so wanted to join it.
Tell me the difference between Mutex and Semaphores with a real-life example. (Learn)
Gave him a proper definition of both and then gave him an example based on classical OS problems.
What is Normalization, and why it is done? (Learn)
Gave him a basic definition and real-life example of a database of a store.
What is REST API? (Learn)
I told him the definition of REST and then explained it through an example of my project in which REST API was used.
Write a shell script to parse a log file. (Learn)
I mentioned that I am familiar with the shell scripting in my resume but could not able to write the script as I didn’t remember the syntax and that’s a learning for me that don’t mention anything about anything if you are not very good about it.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which operator is used for exponentiation in Python?