Tip 1 : Prepare some Projects
Tip 2 : Practice At least 250 Questions of DS algo
Tip 3 : Do at least 2 application based projects
Tip 1 : add some application based projects in your resume.
Tip 2 : Do not put false things on resume.
ALGO, Aptitude, SQL Questions.
Number Of MCQs - 90
Interviewer gave me coding problems and I had to code the given problem on the notepad.



Merge Sort Algorithm -
Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.

The above illustrates shows how merge sort works.
It is compulsory to use the ‘Merge Sort’ algorithm.
MergeSort(arr[], l, r), where l is the index of the first element & r is the index of the last element.
If r > l
1. Find the middle index of the array to divide it in two halves:
m = (l+r)/2
2. Call MergeSort for first half:
mergeSort(array, l, m)
3. Call mergeSort for second half:
mergeSort(array, m+1, r)
4. Recursively, merge the two halves in a sorted manner, so that only one sorted array is left:
merge(array, l, m, r)



A majority element is an element that occurs more than floor('N' / 2) times in the array.
1. Store all the element in a map. key of a map denotes the element of an array and the value denotes the frequency of that element.
2. then return that element whose frequency is more than n/2 times



The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
1. Initialize three pointers prev as NULL, curr as head and next as NULL.
2. Iterate through the linked list. In loop, do following.
// Before changing next of current,
// store next node
next = curr->next
// Now change next of current
// This is where actual reversing happens
curr->next = prev
// Move prev and curr one step forward
prev = curr
curr = next
Interviewer asked me basic HR questions.
1. Introduction.
2. Why do you want to join HCL?
3. Where do you see yourself in next 5 years?

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?