Tip 1 : Prepare basics thoroughly
Tip 2 : Get a good insight on your resume
Tip 3 : Practise coding contests
Tip 1 : Do relevant projects in Development
Tip 2 : Prepare sample questions and answers on your projects.
Timing - 8 pm - 9 pm
Environment - Online with webcam on



Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
It was held in morning from 9 to 10 am.
The interviewer was casual and kept giving me ample time and hints when I deviated from the correct approach.
He made the environment very friendly and tried to relieve the stress I was in.



This can be solved using kth order statistics algorithm. Basically, we need to first find the kth largest element and then partition the array about this element using the quicksort algorithm.
This way it can be done in O(n) time complexity



If the given array is [1, 3, 2], then you need to return [3, -1, -1]. Because for 1, 3 is the next greater element, for 3 it does not have any greater number to its right, and similarly for 2.
Basically, we need to use stack data structure. We iterate over the given array and we keep pushing elements in the stack if the current element is smaller than the element on the top of the stack.
If we encounter a larger number, we just pop elements from the stack which are smaller than the current element and the current element is the next greater element for all of these numbers.

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?