Tip 1 : Don’t create panic in any case in the interview , as even if you are not selected you will learn a lot from your interview experience and perform well in the future.
Tip 2 : Also I would recommend you Coding Ninjas as according to me it is a good platform to learn basic coding concepts and to practice coding.
Tip 1 : Write whatever you are sure about and have actually done that. CGPA plays a good role but not a complete role as it is just eligibility criteria for some companies.
Tip 2 : Have at least 1 or 2 good projects from which you know everything involved in the project.



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]




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
s1- I used Level order approach to solve this question
s2- and the interviewer was quite satisfied with my approach and he was happy with my response.



Let ‘ARR’ be: [1, 4, -5]
The subarray [1, 4, -5] has a sum equal to 0. So the count is 1.
Step 1: discuss naive approach
Step 2: optimise the approach
Step 3: write code
Step 4: discuss corner cases

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?