Tip 1 : Practice coding from coding platforms and do at least 100 questions.
Tip 2 : Practice any one automation framework includes design patterns
Tip 1: Optimize your resume for conciseness by limiting it to a single page while emphasizing hands-on experience.
Tip 2: Showcase proficiency in key areas such as Selenium and Rest Assured automation, underscored by your use of Java as the primary programming language.



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
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.



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 the maximum length of the substring that can be formed by every character in a set of 52 characters (from 'A' to 'Z' and from 'a' to 'z'). To do this, we traverse the entire string, and whenever we find a different character, we increase the count. If the count becomes greater than k (at the right index), we start again from the 0th index, and if we find a different character, we decrease the count. When the count is equal to k (at the left index), the length will be rightIndex - leftIndex + 1. We repeat this process until we reach the end of the string, at which point we return the maximum length. We perform 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 sub-structure 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
There are 100 doors in a row, and all doors are initially closed. A person walks through all the doors multiple times and toggles (if a door is open, then close it; if it is closed, then open it) 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., the 2nd, 4th, 6th, 8th, etc.
In the third walk, the person toggles every third door, i.e., the 3rd, 6th, 9th, etc.
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?
49*(6*5+3)+(6*6)= 1653



for the given 5 intervals - [1,4], [3,5], [6,8], [10,12], [8,9].
Since intervals [1,4] and [3,5] overlap with each other, we will merge them into a single interval as [1,5].
Similarly [6,8] and [8,9] overlaps, we merge them into [6,9].
Interval [10,12] does not overlap with any interval.
Final List after merging overlapping intervals: [1,5], [6,9], [10,12]
Check if any two intervals overlap among a given set of intervals. An interval is given in form of start and end time. Given a set of intervals, check if any two intervals overlap or not.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
When does a stack underflow occur?