Tip 1: Practice medium-level coding questions.
Tip 2: Gain knowledge of software testing.
Tip 3: Develop good projects.
Tip 1: Mention good projects in your resume.
Tip 2: Include something unique in your resume.
This round was conducted on HackerEarth. It was a 2-hour long test in which there were 3 questions. To clear this round, you need to answer all three questions. Only 49 students cleared this round.


The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.
Step 1: Initialize two pointers, left and right, to the first and last indices of the elevation map.
Step 2: Initialize two variables, left_max and right_max, to 0. These variables will track the maximum heights encountered from the left and right directions, respectively.
Step 3: Initialize a variable, water_trapped, to 0. This variable will store the total amount of water trapped.
Step 4: While the left pointer is less than or equal to the right pointer, do steps 5-8.
Step 5: If the height at the left pointer is less than or equal to the height at the right pointer, do steps 6-7; otherwise, do steps 7-8.
Step 6: If the height at the left pointer is greater than or equal to left_max, update left_max to the current height. Otherwise, calculate the water trapped by subtracting the height at the left pointer from left_max and add it to water_trapped. Increment the left pointer.
Step 7: If the height at the right pointer is greater than or equal to right_max, update right_max to the current height.
Otherwise, calculate the water trapped by subtracting the height at the right pointer from right_max and add it to water_trapped.
Decrement the right pointer.
Step 8: After the while loop, return the value of water_trapped.



Input: Let the binary be as shown in the figure:
Output: Linked List: 15 -> 40 -> 62 -> 10 -> 20 -> NULL
Explanation: As shown in the figure, the right child of every node points to the next node, while the left node points to null.
Also, the nodes are in the same order as the pre-order traversal of the binary tree.
Step 1: If the root is None or it is a leaf node (both left and right children are None), return the root as it is already flattened.
Step 2: Recursively flatten the left subtree by calling the flattenTree function on the left child of the root.
Step 3: Recursively flatten the right subtree by calling the flattenTree function on the right child of the root.
Step 4: If the flattened left subtree exists (left child is not None), do the following:
a) Store the original right child of the root in a temporary variable, right_child.
b) Set the left child of the root as None.
c) Set the right child of the root to the flattened left subtree.
d) Find the rightmost node in the flattened left subtree.
e) Set the right child of the rightmost node to the temporary variable right_child.
Step 5: Return the root of the flattened binary tree.
This round was conducted on the Superset platform. This platform is a bit different, the candidates need to be online and the interviewer will call them at the time and the candidates need to pick up the call and attend the interview. This round was scheduled for 20 minutes, but it went on for 25 minutes. The interview was mostly focused on data structures and OOPS concepts.
What is the difference between BFS and DFS? (Learn)
Tip 1: Study about Breadth First Search and Depth First Search.
Tip 2: Hear the question carefully.
What is recursion? How can you perform the recursion? (Learn)
Tip 1: Study recursion in detail
Tip 2: Answer confidently
What is JVM? (Learn)
Tip 1: Study about the Java Virtual Machine.
Tip 2: Hear the question carefully.
What gives Java its 'write once and run anywhere' nature? (Learn)
Tip 1: Study about the Java Virtual Machine
Tip 2: Hear the question carefully
What is a thread in an operating system? (Learn)
Tip 1: Study threads in the operating system.
Tip 2: Hear the question carefully.
This round was conducted on the Superset platform. This platform is a bit different, the candidates need to be online and the interviewer will call them at the time and the candidates need to pick up the call and attend the interview. 24 students were selected after this round.
Give your introduction.
Tip 1: Prepare your introduction
Tip 2: Speak in good English
How do you prioritize your work?
Tip 1: Answer confidently
Tip 2: Don't hide anything
What are your weaknesses?
Tip 1: Better to tell the weakness that does not hinder the growth of the company
Tip 2: Hear the question carefully
Do you have any other offers in hand?
Tip 1: Tell the truth, even if you have an offer
Tip 2: Answer confidently

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