Tip 1 : Be Strong with DSA
Tip 2 : Be Strong with OOPS and Core CS Fundamentals
Tip 1 : One Page Resume
Tip 2 : Highlight your coding profiles
Online Assessment



1. If you encounter a situation when 'B[i]' is greater than the number of remaining nodes in the list, then simply reverse the remaining nodes as a block and ignore all the block sizes from 'B[i]'.
2. All block sizes are contiguous i.e. suppose that block 'B[i]' ends at a node cur, then the block 'B[i+1]' starts from the node just after the node cur.
Linked list: 1->2->3->4->5
Array B: 3 3 5
Output: 3->2->1->5->4
We reverse the first block of size 3 and then move to block 2. Now, since the number of nodes remaining in the list (2) is less than the block size (3), we reverse the remaining nodes (4 and 5) as a block and ignore all the block sizes that follow.



Let the given string be “(()())((”.
Here the valid parentheses substrings are: “()”, “()” and “(()())”. Out of these the longest valid string is “(()())” which has a length 6.
DSA



You can’t sell without buying first.
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
Now let's just understand it with our given example,
Input: prices = [7,1,5,3,6,4]
Output: 5
Remember one rule :- You can only buy one time & sell one time
So, if buy at 7 & sell at any time in the future, we'll face loss. Because buying price is way higher then selling price available we have
Now, I have seen a dip & I buy at 1 & sell at 5 my overall profit will be 5 - 1 = 4
But what if, I had buy at 1 & sell at 6 my profit will be 6 - 1 = 5. Which is greater then my overall profit. So, i will update my overall profit with new value.
Now we have done as further we don't have any higher point to sell. We will return our answer.
Managerial Round



For the given binary tree

The level order traversal will be {1,2,3,4,5,6,7}.
printLevelorder(tree)
1) Create an empty queue q
2) temp_node = root /*start from root*/
3) Loop while temp_node is not NULL
a) print temp_node->data.
b) Enqueue temp_node’s children
(first left then right children) to q
c) Dequeue a node from q.

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?