Tip 1 : Graph should be on your tips.
Tip 2 : While explaining the solution to interviewer, dont just hop onto the most optimal solution. Start with the brute force one, give the cons of brute force solution, and then go step by step till you reach the optimal solution.
Tip 3 : Improve on your communication skills as well.
Tip 1 : Mention only what is required for your profile, for e.g. do not stress too much on your co-curricular stuff. Rather, try explaining more of your technical stuff that is relevant for your job.
Tip 2 : Keep it limited to 1 page. And make sure it's a pdf and not an image.



If ‘ARR’ is {1,2,3,4} and ‘K’ = 4, then there exists 2 subsets with sum = 4. These are {1,3} and {4}. Hence, return true.
Approach (Using DP) :
1) Create a boolean 2D array/list ‘DP’ of size (‘N+1’)*(‘K+1’) i.e. ‘DP[N+1][K+1]’.
2) If ‘K’ is equal to 0, then the answer should be ‘true’. Hence, run a loop from 0 to ‘N’ (say iterator = ‘i’):
‘DP[i][0]’ = true.
3) If ‘K’ is not zero but ‘ARR’ is empty then the answer should be ‘false’. Hence, run a loop from 1 to ‘K’ (say iterator = ‘i’):
‘DP[0][i]’ = false.
4) To fill the ‘DP’ table, run a loop from 1 to ‘N’ (say iterator = ‘i’):
4.1) Run a loop from 1 to ‘K’ (say iterator = ‘j’):
‘DP[i][j]’ = ‘DP[i-1][j]’.
4.2) If ‘j’ is greater than equal to ‘ARR[i-1]’:
‘DP[i][j]’ = ‘DP[i][j]’ OR ‘DP[i-1][j - ARR[i-1]]’.
5) Finally, return ‘DP[N][K]’.
TC : O(N*K), where N = size of the array and K = required sum
SC : O(N*K)



If an interval ends at time T and another interval starts at the same time, they are not considered overlapping intervals.
Approach (Using Sorting) :
1) Sort the list of intervals first on the basis of their start time and then iterate through the array.
2) If the start time of an interval is less than the end of the previous interval, then there is an overlap and we can return true.
3) If we iterate through the entire array without finding an overlap, we can return false.
TC : O(N * logN), where N = total number of intervals.
SC : O(N)


Input: [1,2,3,4,5]
Output: [5,4,3,2,1]

Reverse stack using recursion.



For the given binary tree:

Output: 1 2 3 4 6 7 10
Explanation: The leftmost and rightmost node respectively of each level are
Level 0: 1(only one node is present at 0th level)
Level 1: 2 3
Level 2: 4 6
Level 3: 7 10
I used Level order approach to solve this question and the interviewer was quite satisfied with my approach and he was happy with my response.

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?