Tip 1 : Practice DSA very very well
Tip 2 : Try competitive programming
Tip 3 : Also try to get better in explaining the apporach
Tip 1 : Write only what you have actually done
Tip 2 : Have a balanced resume with something you are very good at and rest above average
it was at 12pm, the interviewer was a male, and was making me very comfortable.



A DAG G has at least one vertex with in-degree 0 and one vertex with out-degree 0.



The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.
Find maximum height of bar from the left end upto an index i in the array left_max.
Find maximum height of bar from the right end upto an index i in the array right_max.
Iterate over the \text{height}height array and update ans:
Add min(left_max[i],right_max[i]) - height[i] to ans
It was at 4pm, the interviewer was a male and was very friendly



If a particular job has a deadline 'x', it means that it needs to be completed at any time before 'x'.
Assume that the start time is 0.
'N' = 3, Jobs = [[1, 1, 30], [2, 3, 40], [3, 2, 10]].
All the jobs have different deadlines. So we can complete all the jobs.
At time 0-1, Job 1 will complete.
At time 1-2, Job 3 will complete.
At time 2-3, Job 2 will complete.
So our answer is [3 80].
Greedily choose the jobs with maximum profit first, by sorting the jobs in decreasing order of their profit. This would help to maximize the total profit as choosing the job with maximum profit for every time slot will eventually maximize the total profit



Input: arr = [2, 1, 5, 6, 2, 3], k = 2
Output: 11
Explanation:
First painter can paint boards 1 to 3 in 8 units of time and the second painter can paint boards 4-6 in 11 units of time. Thus both painters will paint all the boards in max(8,11) = 11 units of time. It can be shown that all the boards can't be painted in less than 11 units of time.
it was at 3 pm, male interviewer, looked like an experienced employee



For ‘N’ = 3, ‘WELLS[]’ = ‘[1,2,2]’, ‘PIPES[]’ = [ [1, 2, 1], [2 , 3, 1]]. The image shows the costs of connecting houses using pipes. The best strategy is to build a well in the first house with cost 1 and connect the other houses to it with cost 2 so the total cost is 3.




An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’.
As we know a ^ a =0 . When we write all substrings, we have to check how many numbers occur an even number of times and how many numbers occur an odd number of times. If the list is 0 indexed, the number at ith index will occur (i+1)*(n-i) times.
If n is even, either i+1 or n-i will be even. Each number will occur an even number of times, and the answer will be 0. If n is odd and i is even, the product of the XOR will be odd. In that case, the answer is the XOR of the even indexed elements.

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?