Tip 1: Practice on coding platforms and solve medium-level problems.
Tip 2: Brush up on computer fundamentals from subjects like OS, DBMS, and CN.
Tip 3: Have a good project or internship experience and possess in-depth knowledge about your work.
Tip 1: Have some projects on your resume.
Tip 2: Do not put false information on your resume.



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.
We can use recursion to solve this problem.
The main idea is to reverse the first ‘K’ nodes ourselves and let the recursive function reverse the rest of the linked list.
Let reverseList() be the recursive function that takes the head of the linked list and ‘K’ as the parameters.
Now we can iteratively reverse the linked list's first ‘K’ nodes.
And then if we still have some nodes left in the linked list, we can call reverseList(), until the nodes are exhausted.



Input: Let the binary tree be:

Output: 2
Explanation: The root node is 3, and the leaf nodes are 1 and 2.
There are two nodes visited when traversing from 3 to 1.
There are two nodes visited when traversing from 3 to 2.
Therefore the height of the binary tree is 2.
To find the depth of the tree, We will do the DFS on the tree starting from the root node.
In DFS, we visit all the nodes (child and grandchild nodes) of one child node before going to the second child node, which will help us determine the tree's height. We will take the maximum of both the child’s height.
We will go to the left node and increase one if it is not NULL and do DFS on the left node, the similar thing we will do on the correct node and return the max of the left and right nodes.



Input: 'arr' = [2, 2, 2, 2, 0, 0, 1, 0]
Output: Final 'arr' = [0, 0, 0, 1, 2, 2, 2, 2]
Explanation: The array is sorted in increasing order.
We can sort the array in one-pass by maintaining three positional pointers ‘zeroPos’, ‘onePos’ and ‘twoPos’ initialised to 0, 0 and N-1, respectively.



Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]
Output: 11
Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
The simple idea of Kadane’s algorithm is to look for all positive contiguous segments of the array. By using Kadane's Algo I Solved this problem.
Tell me about yourself.
Why should I hire you?
What are your strengths and weaknesses?
Why do you want to work at our company?

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?