Tip 1 : Practice Atleast 250 Questions on GFG/Leetcode
Tip 2 : For DSA questions in interviews, start explaining from the brute force approach and then move to the optimal one. Convey your thought process to the interviewers, so that they can help you out if you get stuck.
Tip 3 : Do not write anything that you are not confident of in resume
Tip 4 : Do atleast 2 projects
Tip 1: Try to include at least one development project in your resume.
Tip 2: Interviewer will ask anything from your resume so be prepared for it.
Tip 3 : Don't mention some random projects which you are not sure about or copied from Google or somewhere else.
The first round was an assessment round comprised of MCQ questions of DSA, RDBMS, MySQL questions and 2 coding questions to be written in java only



public class Solution {
public static int helper(int[] houses, int n) {
if(n == 0) return 0;
int[] storage = new int[n + 1];
storage[0] = 0;
storage[1] = houses[0];
for(int i = 2; i < storage.length; i++) {
int op1 = houses[i-1] + storage[i-2];
int op2 = storage[i-1];
storage[i] = Math.max(op1, op2);
}
return storage[n];
}
public static int maxMoneyLooted(int[] houses){
return helper(houses, houses.length);
}
}



Suppose ‘A’ = “brute”, and ‘B’ = “groot”
The shortest supersequence will be “bgruoote”. As shown below, it contains both ‘A’ and ‘B’ as subsequences.
A A A A A
b g r u o o t e
B B B B B
It can be proved that the length of supersequence for this input cannot be less than 8. So the output will be bgruoote.
Query to Find Second Highest Salary in SQL
SELECT MAX(SALARY) FROM Employee WHERE SALARY < (SELECT MAX(SALARY) FROM Employee);
we started with the introduction than he jumped to the dsa questions. He asked me two coding quesions one based upon dp and other on Binary tree



A binary tree is considered balanced if the difference between the left subtree’s height and the right subtree’s height is less than or equal to 1, for all non-leaf nodes.
Consider N=2, there are three different binary trees.




The diameter of a binary tree is the length of the longest path between any two end nodes in a tree.
The number of edges between two nodes represents the length of the path between them.
Input: Consider the given binary tree:

Output: 6
Explanation:
Nodes in the diameter are highlighted. The length of the diameter, i.e., the path length, is 6.
In this round Interviewer asked me difficult DSA problems based on DP and Greedy Algorithms



1. Each student gets at least one book.
2. Each book should be allocated to only one student.
3. Book allocation should be in a contiguous manner.
Input: ‘n’ = 4 ‘m’ = 2
‘arr’ = [12, 34, 67, 90]
Output: 113
Explanation: All possible ways to allocate the ‘4’ books to '2' students are:
12 | 34, 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12’, and student two is ‘34+ 67+ 90 = 191’, so the maximum is ‘max(12, 191)= 191’.
12, 34 | 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 = 46’, and student two is ‘67+ 90 = 157’, so the maximum is ‘max(46, 157)= 157’.
12, 34, 67 | 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 +67 = 113’, and student two is ‘90’, so the maximum is ‘max(113, 90)= 113’.
We are getting the minimum in the last case.
Hence answer is ‘113’.




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'.

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