Tip 1 : Practice Atleast 250 Questions
Tip 2 : Make atleast 2 projects
Tip 1 : Have some projects on resume
Tip 2 : Do not put false things on resume
Aptitude questions + 2 medium level Coding Problem




knightPosition: {3,4}
targetPosition: {2,1}

The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the โstepCountโ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and โstepCountโ becomes 2 which is the final answer.
1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).
2. The knight can make 8 possible moves as given in figure 1.
3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).



This question is a type of 0-1 knapsack problem.
In the Dynamic programming we will work considering the same cases as mentioned in the recursive approach. In a DP[][] table letโs consider all the possible weights from โ1โ to โWโ as the columns and weights that can be kept as the rows.
The state DP[i][j] will denote maximum value of โj-weightโ considering all values from โ1 to ithโ. So if we consider โwiโ (weight in โithโ row) we can fill it in all columns which have โweight values > wiโ. Now two possibilities can take place:
Fill โwiโ in the given column.
Do not fill โwiโ in the given column.
Now we have to take a maximum of these two possibilities, formally if we do not fill โithโ weight in โjthโ column then DP[i][j] state will be same as DP[i-1][j] but if we fill the weight, DP[i][j] will be equal to the value of โwiโ+ value of the column weighing โj-wiโ in the previous row. So we take the maximum of these two possibilities to fill the current state
Interview was in the afternoon
Tell me about yourself
What do you know about the company
Where do you see yourself in 5 years
Are there any questions you want to ask me

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