Tip 1: Solve DSA problems in a pattern-wise manner.
Tip 2: Master core CS fundamental subjects thoroughly.
Tip 3: Do at least two good projects.
Tip 1: Make your resume one page, well-structured, and easy to read, with only relevant information.
Tip 2: Always highlight results using numbers instead of just listing them.
It was conducted during the daytime, around 12:30 pm.
The environment was professional, organized, and slightly tense due to placements, but overall comfortable.
The interviewers were friendly, supportive, and focused on understanding my approach and concepts rather than just the answers.



Each product can cross the integer limits, so we should take modulo of the operation.
Take MOD = 10^9 + 7 to always stay in the limits.
Can you try solving the problem in O(1) space?
1. Initial Approach (Brute Force – O(N²))
For each index i, I calculated the product of all elements except ARR[i].
Used a nested loop: outer loop for each element, inner loop to multiply remaining elements.
This worked but had O(N²) time complexity, which is not efficient for large inputs.
The interviewer asked me to optimize it.
2. Then I optimized it using forward and backward traversal.
Steps:
Create a result array product[] initialized with 1.
Traverse from left → right:
Store prefix product (product of all elements before index i).
Traverse from right → left:
Maintain suffix product and multiply it by the current product[i].
Achieved O(N) time complexity and O(1) extra space (excluding output array).
At last, he asked me to do a dry run on three test cases.
Given an employee table, find the second-highest salary. (Practice)
Tip 1: Practice for SQL queries.
The interview process took place during regular daytime hours.
The overall setup was smooth and well-managed, with some pressure due to the placement season, but still quite comfortable.
The process started with an Online Assessment and then moved to two technical interview rounds.
The interviewers were calm and encouraging, and they mainly focused on how I approached problems and explained my concepts rather than just checking for correct answers.



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.
1. First, I explained the brute force approach where for each index I find left max and right max - O(N²).
2. Then I optimized using two pointers:
Take left and right pointers with leftMax and rightMax.
Move the pointer with smaller height and calculate trapped water using max values.
Add water as:
min(leftMax, rightMax) - height[i]
Final Complexity:
Time: O(N)
Space: O(1)


If two nodes have the same position, then the value of the node that is added first will be the value that is on the left side.
For the binary tree in the image below.

The vertical order traversal will be {2, 7, 5, 2, 6, 5, 11, 4, 9}.
First, I understood that each node has a position defined by row and column, and we need to group nodes column-wise from left to right. Also, if multiple nodes are at the same position, we must sort them by value.
Initially, I thought of using simple level order traversal, but I realized that just BFS is not enough because we also need to track column and row indices.
So, I used BFS with a queue, where I stored each node along with its (row, col) values. While traversing, I updated positions for left (row+1, col-1) and right (row+1, col+1).
To store data properly, I used a nested map with multiset to maintain sorted order automatically.
Finally, I traversed the map column-wise and built the answer.
This approach handled ordering and sorting efficiently with O(N log N) complexity.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which method is called when an object is destroyed in Java?