Tip 1 : Mention some good projects on resume
Tip 2 : Be confident
Tip 3 : Good with computer science basics and ds and algo
Tip 1 : Good Projects
Tip 2 : Having some achievements is plus point



1. The array follows 0-based indexing, so you need to return the 0-based index of the element.
2. Note that the element at the equilibrium index won’t be considered for either left sum or right sum.
3. If there are multiple indices which satisfy the given condition, then return the left-most index i.e if there are indices i,j,k…. which are equilibrium indices, return the minimum among them
4. If no such index is present in the array, return -1.
I used 2 loops. The outer loop iterates through all the elements and the inner loop find out whether the current index picked by the outer loop is the equilibrium index or not. The time complexity of this solution was O(n^2).



n = 4, A = {2, 4, 5, 1}, B = {3, 3, 10, -4}
Now in this example, if we split the array at index 1 then the sum of all the subarrays is 2 + 4 = 6, 5 + 1 = 6, 3 + 3 = 6, 10 + (-4) = 6, and no other index satisfies this condition, hence the answer is 1.
Levi Ackerman has two arrays, ‘A’ and ‘B’ consisting of ‘N’ integers each. He wants to divide these two arrays into two parts each, such that the sum of all the elements in the first part is equal to the sum of elements in the second part, and the index ‘k’ where the splitting is done, must be the same in both the arrays.



In the given linked list, there is a cycle, hence we return true.

I first started off by explaining the question, and cross-questioning if there are any constraints. Explained my approach.
Used slow and fast pointer approach. Walked him through my code. Also did a dry run on an example test case. Interviewer was satisfied.
1. First sorted the array and then iterated it.
2. interviewer asked me to optimise my solution
3. I used a sliding pointer and did it in 1 iteration.
4. He gave a constraint that the array is already sorted. and asked me to solve it in O(n).
5. I used sliding window to solve the question.
6. Did a dry run of the code and explained how the code also covers the edge cases.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?