Tip 1 : Practice Graph and Trees Medium and Hard level questions
Tip 2 : Practice completing 2 Medium level questions in 60 minutes
Tip 3 : Try to give the optimized answer with space and time complexity
Tip 1 : Mention your coding platforms links in your resume.
Tip 2 : Keep it limited to 1 page. The main focus should be on your projects and previous experience or internships. Do write a short summary about the work that you did or add some git repos links for your project.



For the binary trees in the image below.

The left tree in the image is not a complete binary tree that’s why it is invalid and the right tree in the image is a valid complete binary tree which contains total 6 nodes.
Key Point: A complete binary tree can have at most (2h – 1) nodes in total where h is the height of the tree .
Step 1: Compare the left sub-tree height with the right sub-tree height.
Step 2: If they are equal it is a full tree, then the answer will be 2^height – 1.
Step 3: Otherwise, recursively call for the function for the left and right sub-trees and return the sum of them + 1 as the resultant count of nodes.
Time Complexity: O((log N)^2)
Auxiliary Space: O(log N)



If Matrix of size 3 * 5 is:
0 1 1 0 0
0 1 0 1 0
1 0 0 0 0
Then, out of the five coins in the matrix, you can collect a maximum of four coins. This is because the coin at (0, 1) lies on the boundary and after collecting the coin one can also collect the coin at (1, 1) as it lies in the adjacent cell. We can also collect the coin at (2, 0). But we cannot collect the coin at (1, 3), as this coin doesn’t lie on the boundary and it cannot be reached from one of the boundary coins.
Step 1 : Sort the piles in Ascending Order.
Step 2 : Initialize maxCoins = 0 and 2 pointers i = 0 and j =piles.size() - 2
Step 3 : As the goal is to maximize your coins. And you will pick a pile always after Alice. So let Alice pick the largest pile from the end, you pick the second largest pile and Bob will pick the smallest pile from the start.
Step 4 : Keep adding the count of piles to maxCoins till j > i;



You are given ‘MAT’= [[1, 2],[3, 4]] and ‘K’ = 8.

Then the answer will be 7 (the sum of the red rectangle).
Step 1 : Try to reduce the 2D matrix to 1D with row-wise sum.
Step 2 : Find the maximum sum in that 1D array which is at most K.
Time Complexity: O(col*col*row*log(row))
Space Complexity: O(row)



A subarray is a slice from a contiguous array (i.e., occupy consecutive positions) and inherently maintains the order of elements.
Step 1 : Create a map(M1) and store the count of all the numbers.
Step 2 :For all those numbers whose count is greater than 3. Add that to answer.
Step 3 : For rest of the numbers run a nested loop with the map(M1 and M1) and store the difference count in a another map(M2).
Step 4 : Traverse over the map(M2) and all those difference where the count is greater than 3 add then to the answer.
Time Complexity: O(N^2)
Space Complexity: O(N)
Tip 1 : Work on your communication skills for this Round.
Tip 2 : Be Confident While giving any answer.
Tip 3 : You should have a good knowledge of what projects you worked on.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?