Tip 1 : Be very clear with the fundamentals, when we use a particular data structure, what trade-offs are there for commonly used data structures?
Tip 2 : Do practice on a variety of topics and try to give a good number of contests that will help you in solving problems in fixed time.
Tip 1 : Make sure you know everything you put on the resume.
Tip 2 : Have some projects, so you can discuss things with the interviewer.
There were 3 coding problems.
1 Easy, 2 mediums



Input: 'N' = 3, ‘ARR’ = [1, 2, 3]
Output: 3
It is possible to make all elements of the given array equal by three moves only. There is no possible solution that can perform the task in minimum moves than 3.
[1, 2, 3] => [2, 3, 3] => [3, 4, 3] => [4, 4, 4]



Given:
‘N’ = 2, ‘M’ = 3.
‘Hats’ = [[1, 2, 3],
[3, 4, 5]]
The answer will be 8, the combinations can be (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3,5).



The round started with 2 coding Questions and at last, we had a discussion about inheritance and polymorphism.



If N = 7 and K = 3, and the input array is:
{1, 2, 3, 4, 5, 6, 7}
After removing the first three elements, the resulting array now becomes {4, 5, 6, 7} and the sum of the remaining array is equal to 22.
Removing any other combination of three elements will always result in the remaining array sum less than 22.



If the given array is [1,2,3] then the answer would be 2. One of the ways to make all the elements of the given array equal is by adding 1 to the array element with value 1 and subtracting 1 from the array element with value 3. So that final array would become [2,2,2].
The round started with 2 coding Questions and at last, we had a discussion about oops and DBMS concepts.



A binary search tree, also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree.
A balanced binary search tree is a tree in which each node has either 0 or 2 children.
For Example, the root node is given as follows :
‘ROOT’ = 5 2 6 -1 -1 -1 -1 and ‘target’ = 8, The answer will be true since the sum of both leaf nodes is equal to 8.
I stored inorder traversal of the BST in an array and then used 2-pointers to check if a pair exists.
The interviewer asked me to optimize the space as in this case, it is O(N).
I was unable to do that bit.
We can look the space optimized bit in the above solution.




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?