Tip 1 : Practice popular questions from Arrays, Binary Trees, LinkedLists from CodeStudio's Interview Problems.
Tip 2 : Make sure you are aware of calculating the time and space complexity for every problem you're coding.
Tip 3 : Prepare through Mock Interviews to practice explaining your approach while solving in an actual interview.
Tip 1: Describe the best of your projects in as few words as possible. Don't forget to add buzzwords like REST APIs, DB Indexing, Benchmarking, etc., if you worked on the backend.
Tip 2: Don't include school achievements like Olympiads or Class Topper in your resume.
Tip 3: If you have some work experience, present it in a way that markets yourself. Use terms like 'Created/Owned the Project through the entire SDLC'.



A majority element is an element that occurs more than floor('N' / 2) times in the array.
This is a two-step process:
The first step identifies the element that may be the majority element in the array. If there is a majority element in the array, then this step will definitely return the majority element; otherwise, it will return a candidate for the majority element. Check if the element obtained from the above step is the majority element. This step is necessary, as there might be no majority element.



Basically, If we are at s[m-1], we can take as many instances of that coin ( unbounded inclusion ) i.e count(S, m, n – S[m-1] ) ; then we move to s[m-2]. After moving to s[m-2], we can’t move back and can’t make choices for s[m-1] i.e count(S, m-1, n ).



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.
Algorithm:
Keep three counter c0 to count 0s, c1 to count 1s and c2 to count 2s
Traverse through the array and increase the count of c0 if the element is 0,increase the count of c1 if the element is 1 and increase the count of c2 if the element is 2
Now again traverse the array and replace first c0 elements with 0, next c1 elements with 1 and next c2 elements with 2.



n = 5, k = 2 and arr[] = {6, 5, 4, 8, 7}
The array elements in sorted order are [4, 5, 6, 7, 8]. The ‘2-nd’ smallest element in the array is 5, so the answer is 5.
1. Don’t print anything. Return the value of ‘k-th’ smallest element.
2. ‘k’ is a positive integer and not greater than the size of the array.
3. The array ‘arr’ is unsorted, and all the elements of the array are distinct.
We can also use Max Heap for finding the k’th smallest element. Following is an algorithm.
1) Build a Max-Heap MH of the first k elements (arr[0] to arr[k-1]) of the given array. O(k)
2) For each element, after the k’th element (arr[k] to arr[n-1]), compare it with root of MH.
……a) If the element is less than the root then make it root and call heapify for MH
……b) Else ignore it.
// The step 2 is O((n-k)*logk)
3) Finally, the root of the MH is the kth smallest element.
Time complexity of this solution is O(k + (n-k)*Logk)
Tell me about yourself.
Why should I hire you?
What are your strengths and weaknesses?
Why do you want to work at our company?
What is the difference between confidence and over confidence?

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?