Tip 1 : Sharpen your problem-solving skills
Tip 2 : Have a good command over pointers, graphs, and dp
Tip 3 : Make good projects
Tip 1 : Know about each word that is on your resume
Tip 2 : Mention all the contests and hackathons that you have won/participated
This round consists around 25 mcq question and 2 coding questions.



Create a set to check if the character has occurred before or not
I solved it using the sliding window concept
Iterate through the string and find the ans through ans=max(ans,j-i+1)



The diameter of a binary tree is the length of the longest path between any two end nodes in a tree.
The number of edges between two nodes represents the length of the path between them.
Input: Consider the given binary tree:

Output: 6
Explanation:
Nodes in the diameter are highlighted. The length of the diameter, i.e., the path length, is 6.
Find left and right height of the tree at each node
Diameter will be the maximum of left height+ right height
This round contains 2 coding questions



1. If ‘k’ is not present in the array, then the first and the last occurrence will be -1.
2. 'arr' may contain duplicate elements.
Input: 'arr' = [0,1,1,5] , 'k' = 1
Output: 1 2
Explanation:
If 'arr' = [0, 1, 1, 5] and 'k' = 1, then the first and last occurrence of 1 will be 1(0 - indexed) and 2.
I used Binary Search in this question



Since the robot can only move right and down, when it arrives at a point, it either arrives from left or above
If we use dp[i][j] for the number of unique paths to arrive at the point (i, j), then the state equation is dp[i][j] = dp[i][j - 1] + dp[i - 1][j].
It was an offline interview. The interviewer was engaging in the discussion to solve the problem. It was a pen paper round.



Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.
2. Open brackets must be closed in the correct order.
()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Using stack push/pop operations this problem can ve solved



Input: 'list' = [1, 2, 3, 4], 'k' = 2
Output: 2 1 4 3
Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.
All the node values will be distinct.
Make a function to reverse nodes in linked list
Call this function every time when you want to reverse a group of k nodes
Then attach the reversed nodes to the answer

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?