Tip 1: Practice more and more questions (consistency matters in coding).
Tip 2: Participate in contests as well.
Tip 3: Prepare at least 2-3 good projects.
Tip 1: Have some projects on your resume.
Tip 2: Do not put false information on your resume (they will catch you eventually).
It was around morning time (8:30 am - 9:30 am). The interviewer was an SDE 2 at Zupee. He asked me 2 coding problems, both of medium level.



Given an array arr[ ] of n elements, the task is to find the next greater element for each element of the array in the order of their appearance. The next greater element of an element in the array is the nearest element on the right that is greater than the current element. If there does not exist a next greater element for the current element, then the next greater element is -1. For example, the next greater element of the last element is always -1.
we can use two loops to find the Next Greater Element for every integer it will be on O(n2) time complexity
but we can do this in less TC using stacks
The idea is to store the elements for which we have to find the next greater element in a stack and while traversing the array, if we find a greater element, we will pair it with the elements from the stack till the top element of the stack is less than the current element.



Given an array A[] consisting of N scores, write a program to find max score subarray.
We can solve this question by storing the max at each iteration instead of separately calculating it at the end.
Thus, we only need to maintain curMax which is the maximum subarray sum ending at i and maxTillNow which is the maximum sum we have seen till now. And this way of solving this problem is what we popularly know as Kadane's Algorithm

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