Tip 1 : Practice good number of questions on GFG/Leetcode
Tip 2 : Do at least 2 projects
Tip 1 : Have some good projects in your resume
Tip 2 : Do not put false things on resume.
There were 3 coding quetions in this round from DSA. the two question was of medium level but one question was neither difficult nor medium level question.



Method 1: Recursion by Brute-Force algorithm OR Exhaustive Search.
Approach: A simple solution is to consider all subsets of items and calculate the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than W. From all such subsets, pick the maximum value subset.
Optimal Sub-structure: To consider all subsets of items, there can be two cases for every item.
Case 1: The item is included in the optimal subset.
Case 2: The item is not included in the optimal set.
Therefore, the maximum value that can be obtained from ‘n’ items is the max of the following two values.
Maximum value obtained by n-1 items and W weight (excluding nth item).
Value of nth item plus maximum value obtained by n-1 items and W minus the weight of the nth item (including nth item).
If the weight of ‘nth’ item is greater than ‘W’, then the nth item cannot be included and Case 1 is the only possibility.
Method 2 : we can optimise the above method using DP



1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.
A efficient solution would be to find out the first petrol pump where the amount of petrol is greater than or equal to the distance to be covered to reach the next petrol pump. Now we mark that petrol pump as start and now we check whether we can finish the journey towards the end point. If in the middle, at any petrol pump, the amount of petrol is less than the distance to be covered to reach the next petrol pump, then we can say we cannot complete the circular tour from start. We again try to find out the next point from where we can start our journey i.e. the next petrol pump where the amount of petrol is greater than or equal to the distance to be covered and we mark it as start. We need not look at any petrol pump in between the initial petrol pump marked as start and the new start as we know that we cannot complete the journey if we start from any middle petrol pump because eventually we will arrive at a point where amount of petrol is less than the distance. Now we repeat the process until we reach the last petrol pump and update our start as and when required. After we reach our last petrol pump, we try to reach our first petrol pump from the last and let’s say we have a remaining amount of petrol as curr_petrol. Now we again start traveling from the first petrol pump and take the advantage of our curr_petrol and try to reach the start. If we can reach the start, then we may conclude that start can be our starting point.



Subsequences of string "abc" are: ""(empty string), a, b, c, ab, bc, ac, abc.
step 1 : Sort the given array then I found the mathmatical formula to calculate the number of days i could buy that particular Sugar pack.
step 2 : Iterate the whole array and find the number of days then i can calculate number of sugar packs.
I was asked one Coding Question




In the above image, areas in green, red, and violet color are all submatrices of the original 4x4 matrix.
1. Binary valued matrix has only two values in each cell : 0 and 1.
2. A submatrix is a matrix formed by selecting certain rows and columns from a larger matrix.
3. The area of a matrix with 'h' rows and 'w' columns is equal to 'h' * 'w'.
I have gave him a brute force approach in which i found all the reactange with all one for every index. but this was a very naive solution.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: