Tip 1: Try to complete at least one DSA sheet.
Tip 2: Study OOPS and DBMS in detail.
Tip 1: Have at least two strong projects on your resume.
Tip 2: Summer internship experience is also highly beneficial.

Step 1: I first thought of a greedy approach (always pick the smaller element at each position), but it failed because switching costs can affect future choices.
Step 2: Then I realized this is a sequence problem where, at each index, I can choose either array A or B. So, I should use dynamic programming to keep track of both options.
Step 3: I defined two states:
dpA[i] = minimum total cost if I pick from A at position i
dpB[i] = minimum total cost if I pick from B at position i
Step 4: I built the recurrence relation:
dpA[i] = A[i] + min(dpA[i-1], dpB[i-1] + Y)
dpB[i] = B[i] + min(dpB[i-1], dpA[i-1] + X)
Finally, the answer is min(dpA[N], dpB[N]).


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
Step 1: Put all starting sources into a queue at once, and count how many targets exist.
Step 2: Run BFS level by level from all sources simultaneously, spreading to neighbors, updating time, and reducing the target count. At the end, check if any targets remain.
It was a very interactive round, with questions from Linked Lists and OOPs, and involved a lot of discussion.



Merge Sort Algorithm -
Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.

The above illustrates shows how merge sort works.
It is compulsory to use the ‘Merge Sort’ algorithm.
I wrote C++ code and explained it with a dry run.
There are 4 people (A, B, C, and D) who want to cross a bridge at night.
Can they all cross the bridge in 15 minutes?
I've solved this kind of problem before, so I answered it correctly.
The King of a small country invites 1000 senators to his annual party. As a tradition, each senator brings the King a bottle of wine. Soon after, the Queen discovers that one of the senators is trying to assassinate the King by giving him a bottle of poisoned wine. Unfortunately, they do not know which senator, nor which bottle of wine is poisoned, and the poison is completely indiscernible. However, the King has 10 prisoners he plans to execute. He decides to use them as taste testers to determine which bottle of wine contains the poison. The poison when taken has no effect on the prisoner until exactly 24 hours later when the infected prisoner suddenly dies. The King needs to determine which bottle of wine is poisoned by tomorrow so that the festivities can continue as planned. Hence he only has time for one round of testing. How can the King administer the wine to the prisoners to ensure that 24 hours from now he is guaranteed to have found the poisoned wine bottle?
I was not able to solve this problem.
It was a technical and managerial round, starting with an in-depth discussion of the projects mentioned in my resume. I explained both in detail. Then, some DBMS and OOPs questions were asked. Binary search and the motivation behind it were also discussed. Overall, the round was highly discussion-based and aimed at assessing problem-solving capabilities.
It was a very relaxed round. Situational questions were asked, such as where I see myself in five years and what my ambitions are. Overall, it was a very positive round.

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