Tip 1 : Believe in yourself, don't loose confidence if you are not able to solve the problems in single go, thing takes time.
Tip 2 : Be Consistent, always do 2-3 coding questions a day, it will help you in. clearing online test and interviews.
Tip 3 : If preparing for Adobe, you can leave DataBases since Adobe don't. ask questions from this topic.
Tip 4 : Showcase your internships and project in resume at the very top, it will increase your chance to get an interview call. Always remember, getting an interview is much more difficult than clearing it, so please make a good resume.
Tip 1 : Showcase your Internships and Project
Tip 2 : Resume should be clean and eye catchy



1. The array follows 0-based indexing, so you need to return the 0-based index of the element.
2. Note that the element at the equilibrium index won’t be considered for either left sum or right sum.
3. If there are multiple indices which satisfy the given condition, then return the left-most index i.e if there are indices i,j,k…. which are equilibrium indices, return the minimum among them
4. If no such index is present in the array, return -1.
The expectation was to solve this problem in O(n).
I traversed the array from both the end (left and right) and stooped where my int leftSum == int. rightSum.



1. A node will be in the bottom-view if it is the bottom-most node at its horizontal distance from the root.
2. The horizontal distance of the root from itself is 0. The horizontal distance of the right child of the root node is 1 and the horizontal distance of the left child of the root node is -1.
3. The horizontal distance of node 'n' from root = horizontal distance of its parent from root + 1, if node 'n' is the right child of its parent.
4. The horizontal distance of node 'n' from root = horizontal distance of its parent from the root - 1, if node 'n' is the left child of its parent.
5. If more than one node is at the same horizontal distance and is the bottom-most node for that horizontal distance, including the one which is more towards the right.
Input: Consider the given Binary Tree:

Output: 4 2 6 3 7
Explanation:
Below is the bottom view of the binary tree.

1 is the root node, so its horizontal distance = 0.
Since 2 lies to the left of 0, its horizontal distance = 0-1= -1
3 lies to the right of 0, its horizontal distance = 0+1 = 1
Similarly, horizontal distance of 4 = Horizontal distance of 2 - 1= -1-1=-2
Horizontal distance of 5 = Horizontal distance of 2 + 1= -1+1 = 0
Horizontal distance of 6 = 1-1 =0
Horizontal distance of 7 = 1+1 = 2
The bottom-most node at a horizontal distance of -2 is 4.
The bottom-most node at a horizontal distance of -1 is 2.
The bottom-most node at a horizontal distance of 0 is 5 and 6. However, 6 is more towards the right, so 6 is included.
The bottom-most node at a horizontal distance of 1 is 3.
The bottom-most node at a horizontal distance of 2 is 7.
Hence, the bottom view would be 4 2 6 3 7
he following are steps to print the Bottom View of the Binary Tree.
Initialize variable hd = 0,map m with int-int key value pair and queue q to store nodes level-wise.
Set root->hd = hd and push root in q
Run a while loop till q is empty
Store the front element in node temp and temp ->hd in variable hd and pop it then set temp->data as value for key hd in m i.e. m[hd] = temp->data.
If temp -> left is not NULL and set temp->left->hd = hd-1 as well as If temp -> right is not NULL and set temp->right->hd = hd+1 respectively.
Iterate over the keys and print the values.
What is OOPS?



Input:
str="AABC" k=1
Output:3
Explanation: Replace 'B' with 'A', we will get "AAAC" and the longest substring with same character is "AAA" of length 3.
We check for each character of English alphabet (both upper and lower cases one by one). We are basically looking for maximum length of sub-string that can be formed by each character and whichever character will form the sub-string of maximum length then that length will be our answer.
We check for maximum length of sub-string that can be formed by every character in a set of 52 characters (From ‘A’ to ‘Z’ and from ‘a’ to ‘z’).
For doing this we traverse whole string and whenever we find a different character, we increase the count.
If count becomes greater than k (at right index), we again start from 0th index and if we found different character we will decrease the count.
When count will be equal to k (at left index) then at that point the length will be rightIndex-leftIndex+1.
We repeat this process until we reach at the end of string and at that point we will return the maximum length.
We do this for all characters and finally return the maximum length.



Input: ‘str1’ = “abcjklp” , ‘str2’ = “acjkp”.
Output: 3
Explanation: The longest common substring between ‘str1’ and ‘str2’ is “cjk”, of length 3.
Dynamic Programming can be used to find the longest common substring in O(m*n) time. The idea is to find the length of the longest common suffix for all substrings of both strings and store these lengths in a table.
The longest common suffix has following optimal substructure property.
If last characters match, then we reduce both lengths by 1
LCSuff(X, Y, m, n) = LCSuff(X, Y, m-1, n-1) + 1 if X[m-1] = Y[n-1]
If last characters do not match, then result is 0, i.e.,
LCSuff(X, Y, m, n) = 0 if (X[m-1] != Y[n-1])
Now we consider suffixes of different substrings ending at different indexes.
The maximum length Longest Common Suffix is the longest common substring.
LCSubStr(X, Y, m, n) = Max(LCSuff(X, Y, i, j)) where 1 <= i <= m and 1 <= j <= n
Design a 3 elevator system for 8 floors
Tip 1 : Don't hesitate, interviewer is not. expecting you to solve this problem fully, just tell your approach in a nice way
Tip 2 : Take your time and think.
Tip 3 : Do practice LLD and HLD with DSA.
It was a managerial round.
There are 100 doors in a row, all doors are initially closed. A person walks through all doors multiple times and toggle (if open then close, if close then open) them in the following way:
In the first walk, the person toggles every door
In the second walk, the person toggles every second door, i.e., 2nd, 4th, 6th, 8th, …
In the third walk, the person toggles every third door, i.e. 3rd, 6th, 9th, …
Likewise,
In the 100th walk, the person toggles the 100th door.
Which doors are open in the end?
In a one day international cricket match, considering no extras(no wides, no ‘no’ balls, etc.) and no overthrows.
What is the maximum number of runs that a batsman can score in an ideal case ?

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?