Tip 1 : Mention some good projects on resume
Tip 2 : Be confident
Tip 3 : Good with computer science basics and ds and algo
Tip 1 : Good Projects
Tip 2 : Having some achievements is plus point
10 MCQ each of 4 Marks and 3 Coding Questions in which 2 of them is of 20 marks and 1 of 50 Marks.
It is a standard problem of DP
I first given him the recursive solution then optimized using dp
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.
First I gave bruteforce solution then optimized
Approach: to find the highest bar on the left and right, array traversal is needed which reduces the efficiency of the solution. To make this efficient one must pre-compute the highest bar on the left and right of every bar in linear time. Then use these pre-computed values to find the amount of water in every array element.
n = 4, ARR1 = {1, 2, 3, 4}, ARR2 = {-1, 3, 4, 2}
The maximum value of the expression is obtained when indexes ‘i = 0’ and ‘j = 3’. After evaluating the expression, we get:
|ARR1[0] - ARR2[3]| + |ARR2[0] - ARR2[3]| + |0 - 3| => |1 - 4| + |-1 - 2| + |-3| => |-3| + |-3| + 3 => 9
So the answer is 9.
first we can easily solve using two for loops
then we can optimize by removing mod operations, doing simple maths
Input:
2 4 5 -1
Output:
5 4 2 -1
Explanation: 2->4->5 is the initial linked list. If we reverse this, we get 5->4->2.
I gave recursive and iterative approaches then code it.
This was just a formality round. Questions like Tell me about yourself, Why do you want to join etc
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does HTML stand for?