Tip 1: Solve standard DSA problems.
Tip 2: Include at least two good projects in your resume.
Tip 3: Study the fundamentals of computer networks.
Tip 1: Coding profile links.
Tip 2: Projects in the resume.
This round primarily focused on the basics of JavaScript and standard DSA problems. The interviewer was humble and attentive, carefully listening to my explanations. The interview was held in the evening, from 5 to 6 PM.
1. You can not slant the container i.e. the height of the water is equal to the minimum height of the two lines which define the container.
2. Do not print anything, you just need to return the area of the container with maximum water.
For the above Diagram, the first red marked line is formed between coordinates (2,0) and (2,10), and the second red-marked line is formed between coordinates (5,0) and (5,9). The area of water contained between these two lines is (height* width) = (5-2)* 9 = 27, which is the maximum area contained between any two lines present on the plane. So in this case, we will return 3* 9=27.
Two Pointer Technique:
Use two pointers, one starting at the beginning of the array and the other at the end. This technique explores all possible container widths while minimizing redundant calculations.
Calculate Area:
At each step, calculate the area formed by the vertical lines at the two pointers. The area is determined by the formula:
Area= (distance between pointers) ×min(height[left], height[right])
Move the Smaller Pointer:
To maximize water storage, move the pointer pointing to the shorter vertical line inward. This is because the height of the container is limited by the shorter line, and moving it inward might lead to a taller container.
Repeat Until Pointers Meet:
Continue the process until the two pointers converge. Keep track of the maximum area encountered during this process.
This approach ensures an efficient solution with a time complexity of O(n), as each line is processed at most once.
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.
The approach is mainly based on the following facts:
This round was conducted with the CTO of the company and was quite challenging. I was asked to design the schema for a TA request system, including the complete flow and requirements. The expectations for this round were extremely high, as it was the final interview.
Design a schema for a TA request system, including the full flow and requirements.
Tip 1: Practice schema design for some case studies.
Tip 2: Discuss the requirements in detail initially before providing a solution.
Tip 3: Discuss everything possible; don’t readily change the schema if any requirements change.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which keyword is used for inheritance?