Tip 1 : Practice questions from all the topics as much as possible
Tip 2 : Be very much attentive while doing projects in college or anywhere, they are asked in detail if mentioned in resume.
Tip 3 : Be consistent while practicing and do a variety of questions rather than doing more questions of same kind.
Tip 1 : You should know whatever you have mentioned in your resume. Don't brag in your resume ever. Be very precise. It doesn't matter how much you have done, what matters is you are very much confident and clear about what you have done.
Tip 2 : Put your projects and the language you code in for sure in your resume.
This was an online technical round on the mettl platform, the test window was open from 22 to 25 May 2020
The test had 28 mcqs and 2 coding questions.
The test was proctored. One needed to have webcam on.
A sample test link was provided before test to get familiar with the mettl platform.



A pair ('ARR[i]', 'ARR[j]') is said to be an inversion when:
1. 'ARR[i] > 'ARR[j]'
2. 'i' < 'j'
Where 'i' and 'j' denote the indices ranging from [0, 'N').
Brute Force Approach got submitted.
Approach:
I used and O(n^2) approach, where I used 2 for loops.
step1 : First loop was from index 0 to sizeof given array i.e. i
step2 : inside this was another loop from index of first loop + 1 to the end of array i.e. j.
step3 : If the value of array[i]>array[j] add 1 to the count of inversions.
Then return count of inversions at the end of both the for loops.



For example:
If the given array is {1, 5, 2, 3, 4}, the output will be 2 (which is GCD of 2 and 4, all other pairs have a GCD of 1)
I used simple approach to solve this problem.
Step1 : First of all make a GCD function using Euclidean Algorithm. O(NlogN)
Step2 : Then using two nested for loops find gcd of all the possible pair of the array and find their gcd and return the maximum of all gcd.
Time : 12pm to 1pm
Mode of Interview : Amazon Chime Video
LiveCode : To write code, it was not a compiler
The interviewer was quite supportive.
Given an array A( all 0 values initially) of size n, given q queries(query eg1: start = i, end =j)(here start and end are index such that you have to add 1 from start index to end index in array A). Return the array A after performing q queries.eg : size of array = 10queries:q1 = 5 8q2 = 6 8output = 0 0 0 0 0 1 2 2 2 0
For a query q(a,b):
Step 1 : I added 1 in the array at the starting index of the given query ( that is the left boundary of given range).
for the ending index (that is the right boundary of the range) I subtracted 1 from the value present at index b+1. if b+1 is a valid index of the given.
Step 2 : Repeat the same process for all the given queries and at the end find cumulative sum of the array an that means
for (int i=1 to size of array)
array[i] = array[i-1]
Step 3 : Return the resulting array.



A majority element is an element that occurs more than floor('N' / 2) times in the array.
Return Middle element of the array that is return A[n/2].


1)Consider all 0’s in arr[] as -1.
2)Create a hash table that holds the count of each sum[i] value, where sum[i] = sum(arr[0]+..+arr[i]), for i = 0 to n-1.
3)Now start calculating cumulative sum and then we get increment count by 1 for that sum represented as index in the hash table. Sub-array by each pair of positions with same value of cumulative sum constitute a continuous range with equal number of 1’s and 0’s.
4)Now traverse the hash table and get the frequency of each element in the hash table. Let frequency be denoted as freq. For each freq > 1 we can choose any two pair of indices of sub-array by (freq * (freq – 1)) / 2 number of ways . 5)Do the same for all freq and sum up the result that will be the number all possible sub-arrays containing equal number of 1’s and 0’s.
Time : 11 am to 12am
Mode of Interview : Amazon Chime Video
LiveCode : To write code, it was not a compiler
The interviewer was quite supportive.



I solved this problem with the very first approach that can come to anyone's mind.
That is using recursion
Step 1 : Make a separate function to find middle element of a list using runner technique.
Step 2 : Find middle element of the list and make it the root of the bst and pass the left part of middle node of the list in the function to return the left node of the current node of bst and right part to get the right child subtree of the current node of bst.
Step 3 : Return root of bst.



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

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?