Tip 1 : Be clear on basics and all fundamental concepts.
Tip 2 : Do at least 2 relevant projects and attend hackathon if possible . It helps to stand out of other( especially for Off campus Tier 3)
Tip 3 : Do read previous interview exp to understand current trends .
Tip 1 : Have good relevant projects. So, you can talk about in the interviews .
Tip 2 : Be confident
HR sent me the link of Hacker Rank test. I was given choice to take test in less than a week.



If the given ‘HEIGHT’ array is [10,20,30,10], the answer 20 as the frog can jump from 1st stair to 2nd stair (|20-10| = 10 energy lost) and then a jump from 2nd stair to last stair (|10-20| = 10 energy lost). So, the total energy lost is 20.
Algorithm:
Defining 'REC'(i,’ HEIGHTS’ , ‘DP’) function :
If i equal to the length of ‘HEIGHTS’ - 1:
Return 0.
If DP[i] is not equal to -1:
The precomputed value was found.
Return DP[i].
Set ‘ONE_JUMP’ as INF.
Set ‘TWO_JUMP’ as INF.
If i+1 < length of ‘HEIGHTS’:
Set ‘ONE_JUMP’ as abs(HEIGHTS[i]-HEIGHTS[i+1]) + REC(i+1,HEIGHTS,DP).
If i+2 < length of ‘HEIGHTS’:
Set ‘TWO_JUMP’ as abs(HEIGHTS[i]-HEIGHTS[i+2]) + REC(i+2,HEIGHTS,DP).
Set ‘ANS’ as minimum of ONE_JUMP and TWO_JUMP.
Set DP[i] as ‘ANS’.
Return ‘ANS’.
Declare an array DP of size (N+1) to memoize this DP solution.
Set all values of DP to -1.
Set ‘ANS’ as REC(1,HEIGHTS,DP).
Return ‘ANS’.



1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Step 1 : Sort the Array.
Step 2: Find the required numbers.
Step 3 : run the logic on the values and return the answer.
Technical interview with a Senior engineer in the firm



Consider the number of vertices is 4 and number of edges is 3, and the array of edges is:
[ [0, 1]
[1, 2]
[2, 3] ]
there exists one path between 0 and 2, which is 0 -> 1 -> 2. Hence, the answer is 'true'.
Approach: The solution is to perform BFS or DFS to find whether there is a path or not. The graph needs not to be created to perform the bfs, but the matrix itself will be used as a graph. Start the traversal from the top right corner and if there is a way to reach the bottom right corner then there is a path.
Algorithm:
Create a queue that stores pairs (i,j) and insert the (0,0) in the queue.
Run a loop till the queue is empty.
In each iteration dequeue the queue (a,b), if the front element is the destination (row-1,col-1) then return 1, i,e there is a path and change the value of mat[a][b] to -1, i.e. visited.
Else insert the adjacent indices where the value of matrix[i][j] is not -1.
Many Java OOPS-related Questions.
Then asked me about the projects.
Then they asked me to make the complete architecture of my recent project. And, they asked a lot of questions about this.
Tip 1 : Be confident
Tip 2 : Be clear on every thing you mentioned on your resume.
Firstly, he asked me to introduce myself.
Then, he asked questions on my projects in my current company(Ended up discussing them for a good time)
Followed by OS , DBMS , Coding questions



An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.
{ “abc”, “ged”, “dge”, “bac” }
In the above example the array should be divided into 2 groups. The first group consists of { “abc”, “bac” } and the second group consists of { “ged”, “dge” }.
The idea is to sort each word on the list and construct a map where the map’s key is each sorted word, and the map’s value is a list of indices in the array where it is present. After creating the map, traverse the map and get indices for each sorted key. The anagrams are present in the actual list at those indices.



If two nodes have the same position, then the value of the node that is added first will be the value that is on the left side.
For the binary tree in the image below.

The vertical order traversal will be {2, 7, 5, 2, 6, 5, 11, 4, 9}.
// min --> Minimum horizontal distance from root
// max --> Maximum horizontal distance from root
// hd --> Horizontal distance of current node from root
findMinMax(tree, min, max, hd)
if tree is NULL then return;
if hd is less than min then
*min = hd;
else if hd is greater than max then
*max = hd;
findMinMax(tree->left, min, max, hd-1);
findMinMax(tree->right, min, max, hd+1);
printVerticalLine(tree, line_no, hd)
if tree is NULL then return;
if hd is equal to line_no, then
print(tree->data);
printVerticalLine(tree->left, line_no, hd-1);
printVerticalLine(tree->right, line_no, hd+1);
Question-related to Threads, process, Deadlock, how to avoid deadlock, Daemon Threads, Thrashing, Multithreading, Scheduling Algorithms, and many more
Tip 1 : Overall, I was confident and I gave my best for every question I encountered for. (No regrets)
Design a database for a school management system, explain Table schema and Support basic operations on the System.
Entities: Teachers, Students, Subjects
Constraints :1 student can opt for more than one subject and 1 teacher can teach more than 1 subject (possible)
Open Ended Question
Tip 1 : Clearly explain each table , all the columns .
Tip 2 : Explain Foreign key mappings
Tip 3 : Be confident
HR Discussion

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