Tip 1: Practice DSA
Tip 2: Focus on OOPs and DBMS
Tip 3: Maintain consistency
Tip 1: Highlight skills in your resume and add internship details if you have completed any.
Tip 2: Highlight achievements and core skills along with soft skills.
There were three questions, and we were allotted one hour to solve them.



F(n) = F(n-1) + F(n-2),
Where, F(1) = F(2) = 1.
For ‘N’ = 5, the output will be 5.
I used recursion for solving the problem.

Let's say, 'PRICES' = [7, 1, 5, 4, 3, 6]
Purchase stock on day two, where the price is one, and sell it on day three, where the price is five, profit = 5 - 1 = 4.
Purchase stock on day five, where the price is three, and sell it on day six, where the price is six, profit = 6 - 3 = 3.
Total Profit is 4+3 = 7. Hence we return 7.
The idea is to traverse the array from left to right and do the following:
Find a local minimum and then a local maximum.
Compute the difference between the two and add it to the result.



'ARR' = [3, 4, -1, 1, 5] and 'K' = 3
Output = [4, 4, 5]
Since the maximum element of the first subarray of length three ([3, 4, -1]) is 4, the maximum element of the second subarray of length three ([4, -1, 1]) is also 4 and the maximum element of the last subarray of length three ([-1, 1, 5]) is 5, so you need to return [4, 4, 5].
The idea is very basic: run a nested loop. The outer loop will mark the starting point of the subarray of length K, while the inner loop will run from the starting index to index + K and print the maximum element among these K elements.



Use a standard approach like recursion.



Input: ‘n’ = 4, ‘a’ = [3, 6, 2, 8] , ‘h’ = 7
Output: 3
Explanation: If ‘m’ = 3, then
The time taken to empty the 1st pile is 1 hour.
The time taken to empty the 2nd pile is 2 hour.
The time taken to empty the 3rd pile is 1 hour.
The time taken to empty the 4th pile is 3 hour.
Therefore a total of 7 hours is taken. It can be shown that if the rate of eating bananas is reduced, they can’t be eaten in 7 hours.
The idea is to solve the problem by applying binary search.
The lower limit of speed is 1 banana/hour, as Koko must eat at least one banana per hour, and the upper limit is the maximum number of bananas among all piles.
Apply binary search on the possible range of answers to find the minimum speed at which Koko can eat all the bananas within K hours.
If the current speed (mid) is sufficient to eat all the bananas within the given K hours, update the minimum eating time and continue the search in the lower half of the range to check for slower eating speeds.
Otherwise, search in the upper half of the range, as we need to increase the eating speed.


If the given matrix is:
[ [1, 2, 5],
[3, 4, 9],
[6, 7, 10]]
We have to find the position of 4. We will return {1,1} since A[1][1] = 4.
The idea is to remove a row or column in each comparison until an element is found. Start searching from the top-right corner of the matrix. There are three possible cases:
x is greater than the current element: This means that all the elements in the current row are smaller than the given number, as the pointer is already at the right-most element and the row is sorted. Thus, the entire row is eliminated, and the search continues from the next row.
x is smaller than the current element: This means that all the elements in the current column are greater than the given number. Thus, the entire column is eliminated, and the search continues from the previous column, i.e., the column immediately to the left.
The given number is equal to the current element: This will end the search.

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