Tip 1: Runnable code is expected in the interview. SO practice that in committed time.
Tip 2: Focus on LLD & HLD explanation using some online tool.
Tip 3: Having projects on GitHub will be a plus point.
Tip 1: Mention personal projects if you have one. (will be a plus)
Tip 2: Mention microservice concerts and projects and if you handled a team (1-2 people also) then mention that.
Tip 3: Keep it 1 pager, include only relevant skills & projects.
There were 2 DSA coding questions which were to be completed in 90 minutes. You must score more than 60% to be considered for further rounds. So, I would recommend you attempt both questions because the weightage for the second question is more than that of the first question.



Approach: A binary search tree (BST) follows a property that for each node, its left child can only have a smaller value than the parent, and a right child can only have a greater value. Thus, we don't need to check the right child at any instance.
Start from the root and move in only the left direction. The leftmost leaf node in the tree is our answer.
If the tree is left-skewed, this optimized approach works the same as the normal traversal, shown in Approach-1.
Algorithm:
A pointer to the root node is given.
While the current node is not a leaf node.
Move the pointer to the left child of the current node.
Return the current node's value, which is the leftmost leaf node of the tree.



1) If the left subtree exists it should contain only nodes with values less than the current node's value.
2) If the right subtree exists it should contain only nodes with values greater than the current node's value.
3) Both the left and right subtrees should also be Binary Search Tree.

For the above binary tree, the BST with the maximum possible sum is marked with RED colour, the sum of this BST is equal to 6.
After clearing the test, I received a call from the recruiter regarding the next three rounds, which were to be scheduled on a single day. Based on my availability, my interviews were scheduled. During the interviews, I was asked two coding questions: one easy and one medium level. I was able to solve both of them with optimized solutions.



You are given arr = {1, 3, 8, 6, 7}, then our answer will be 3.
Sorted form of arr = {1, 3, 6, 7, 8}. The maximum absolute difference between two consecutive elements is 6 - 3 = 3, which is the correct answer.



If two rows have the same number of 1’s, return the row with a lower index.
If no row exists where at-least one '1' is present, return -1.
Input: ‘N’ = 3, 'M' = 3
'ARR' =
[ [ 1, 1, 1 ],
[ 0, 0, 1 ],
[ 0, 0, 0 ] ]
Output: 0
Explanation: The 0th row of the given matrix has the maximum number of ones.
First I started with a brute force approach and later on interviewer asked me to optimise it further.
A simple method is to do a row-wise traversal of the matrix, count the number of 1s in each row, and compare the count with the max. Finally, return the index of the row with a maximum of 1s. The time complexity of this method is O(m*n) where m is the number of rows and n is the number of columns in the matrix.
The following method works in O(m+n) time complexity in the worst case.
Step 1: Get the index of first (or leftmost) 1 in the first row.
Step 2: Do the following for every row after the first row
…IF the element on the left of the previous leftmost 1 is 0, ignore this row.
…ELSE Move left until a 0 is found. Update the leftmost index to this index and max_row_index to be the current row.
The time complexity is O(m+n) because we can go as far left as we came ahead in the first step.
In this round, two DSA coding questions were asked, one of which was easy, while the other was harder, focusing on the topic of dynamic programming.



You can’t sell without buying first.
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
public:
int maxProfit(int[] prices) {
if(prices.length == 1)
return 0;
int min=prices[0];
int profit=0;
for(int i=1; i if(prices[i] < min)
min = prices[i];
else
profit = Math.max(profit, prices[i] - min);
}
return profit;
}
}



If S = “34”, then all the possible letters that can be formed from string S are {“dg”, “dh”, “di”, “eg”, “eh”, “ei”, “fg”, “fh”, “fi”}.
After completing the initial three rounds, a fourth round of system design was scheduled. To be eligible for this round, they checked that I had solved at least three out of four questions in the previous rounds. The interviewer asked me about basic LLD concepts and presented a problem. He was interested in the right approach rather than in-depth knowledge, as expected at the SDE2 level.
The goal of this exercise is to design a system like Google Search, which accepts a query string and returns a set of documents to the user. We are given the following: a UI that accepts the query and can make an RPC out to another server, which will accept a query and return a list of the top 10 documents related to it. The goal is to focus on the overall system architecture, not any specifics of ranking or information retrieval.
Tip 1: Read up on LLD concepts like load balancer, sharding, and scaling.
Tip 2: Understand what downstream is and how application servers work.
Tip 3: Clarify the requirements and ask questions to ensure an understanding of what exactly is being sought.
Tip 4: Utilize design patterns whenever applicable.
Tip 5: Apply object-oriented programming (OOP) concepts effectively.

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