Tip 1 : Be consistent in leetcoding
Tip 2 : Make 2 projects with proper use cases
Tip 3 : Be confident and don't be disheartened with rejection
Tip 1: Make projects which stands out
Tip 2: If you put false things it can backfire in interview
This round started at 8 am



Given ‘NUM = 9’
Binary representation of ‘9 = 1001’, so there are 2 times 1's present.
Print ‘2’ as the answer.



Note that a polygon can be divided into triangles in more than one way. You need to print the minimum sum of triangle values of all the triangles created.
Given 'N' = 4, Array = [4, 3, 5, 2], the possible scores for these two triangle score are: (3 * 2 * 5) + (3 * 2 * 4) = 54 and (4 * 2 * 5) + (4 * 3 * 5) = 100.
The minimum of these two triangle scores is 54. So you need to print 54.

This can be solved by BFS DFS and DSU, i applied DFS traversal with memoization of visited nodes.
Write an SQL query to find employees who have the highest salary in each of the departments.
Return the result table in any order.
Tip 1: Do practice for SQL queries



If the given matrix is:
[ [1, 2, 5],
[3, 4, 9],
[6, 7, 10]]
We have to find the position of 4. We will return {1,1} since A[1][1] = 4.
Let the given element be x, create two variable i = 0, j = n-1 as index of row and column.
Run a loop until i < n.
Check if the current element is greater than x then decrease the count of j. Exclude the current column.
Check if the current element is less than x then increase the count of i. Exclude the current row.
If the element is equal, then print the position and end.
Print the Element is not found



1. Push(num): Push the given number in the stack.
2. Pop: Remove and return the top element from the stack if present, else return -1.
3. Top: return the top element of the stack if present, else return -1.
4. getMin: Returns minimum element of the stack if present, else return -1.
For the following input:
1
5
1 1
1 2
4
2
3
For the first two operations, we will just insert 1 and then 2 into the stack which was empty earlier. So now the stack is => [2,1]
In the third operation, we need to return the minimum element of the stack, i.e., 1. So now the stack is => [2,1]
For the fourth operation, we need to pop the topmost element of the stack, i.e., 2. Now the stack is => [1]
In the fifth operation, we return the top element of the stack, i.e. 1 as it has one element. Now the stack is => [1]
So, the final output will be:
1 2 1
Create a class node that has two variables Val and min. Val will store the actual value that we are going to insert in the stack, whereas min will store the min value so far seen up to that node



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.
Declare a character stack (say temp).
Now traverse the string exp.
If the current character is a starting bracket ( ‘(‘ or ‘{‘ or ‘[‘ ) then push it to stack.
If the current character is a closing bracket ( ‘)’ or ‘}’ or ‘]’ ) then pop from stack and if the popped character is the matching starting bracket then fine.
Else brackets are Not Balanced.
After complete traversal, if there is some starting bracket left in stack then Not balanced, else Balanced.



'S' = "{}()".
There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
Let lo, hi respectively be the smallest and largest possible number of open left brackets after processing the current character in the string.
If we encounter a left bracket (c == '('), then lo++, otherwise we could write a right bracket, so lo--. If we encounter what can be a left bracket (c != ')'), then hi++, otherwise we must write a right bracket, so hi--. If hi < 0, then the current prefix can't be made valid no matter what our choices are. Also, we can never have less than 0 open left brackets. At the end, we should check that we can have exactly 0 open left brackets.
It was a Managerial Round -
Manager was a very chill and friendly person and he started with asking things about me other than my resume
He asked me if he had a talk with one of my professors, what will be the two positive things he will get to know about me
Similarly, he asked what will be the two negative things he will get to know about me
He asked what were steps I had taken to deal with my negatives.
He asked me to brief him about any one of my projects and asked me questions related to it like what was my motivation behind it, what were the problems faced by me, what was the tech stack I used.
He asked me in which development will I be interested in backend or Android development.
I replied with backend and then he asked me can I work full-stack too.
I said yes and then he started asking me about the differences between reactJs and vanillaJs and why I preferred react over vanilla and we had a discussion about it for 5 minutes.
He then asked me about differences between nodeJs and a framework like expressJs for server-side coding he asked me about the libraries i used for backend, problems faced in expressJs and how can we improve those problems while using express.js.
He then asked me why I used MongoDB instead of some other Database and had a discussion about it for 5 minutes
Finally, he wrapped up by asking me if I had any questions

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: