Tip 1 : Graph should be on your tips.
Tip 2 : while explaining the solution to interviewer, dont just hop onto the most optimal solution. Start with the brute force one, give the cons of brute force solution, and then go step by step till you reach the optimal solution.
Tip 3 : Improve on your communication skills as well.
Tip 1 : Mention only what is required for your profile, for e.g. do not stress too much on your co curricular stuff. Rather, try explaining more of your technical stuff that is relevant for your job.
Tip 2 : keep it limited to 1 page. And make sure its a pdf and not an image.


1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.



1. The string is made up of lowercase English alphabets, ‘?’ and ‘:’ special characters.
2. The alphabets may be repeated in the string.
3. The expression which uses ‘?:’ is known as ternary expression and the expression will be evaluated as (condition ? value_if_true : value_if_false).
Step 1 : First, we compare the key with the element at mid1. If found equal, we return mid1.
Step 2 : If not, then we compare the key with the element at mid2. If found equal, we return mid2.
Step 3 : If not, then we check whether the key is less than the element at mid1. If yes, then recur to the first part.
Step 4 : If not, then we check whether the key is greater than the element at mid2. If yes, then recur to the third part.
Step 5 : If not, then we recur to the second (middle) part.






Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").



We cannot use the element at a given index twice.
Try to do this problem in O(N) time complexity.
Hashing Solution
We can store the frequency of every element in the array in a hashmap.
We will loop over every index i, and check the frequency of (Target - ARR[i]) is the hashmap:
If (Target - ARR[i]) is equal to ARR[i], we will check if frequency of ARR[i] . If it is greater than 1 then we will decrease the frequency of ARR[i] by 2 and add a pair (ARR[i] , ARR[i]) to our answer.
Else, if the frequency of ARR[i] and Target - ARR[i] is greater than equal to 1 then we add pair (ARR[i], Target - ARR[i]) to our answer and decrease the frequency of both by 1.
If no valid pairs exist, we will return [[-1,-1]].

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