Tip 1 : Prepare OS,DBMS,OOPs too
Tip 2 : Mention at-least one project or past work experience in your resume
Tip 3 : Try maintaining 8+ CGPA as sometimes shortlist is done based on CGPA
Tip 4 : Try past interview questions from Leetcode,Interviewbit.
Tip 1 : Try to Keep Resume 1 Pager
Tip 2 : Have atleast one project or past work experience mentioned
Tip 3 : Don't put false things on Resume as questions are asked in detail from Resume
The first Round was held on Hackerrank and the questions were of medium difficulty based on Data Structures and Algorithms.
The time of test was 1:00 PM and it was of 45 minutes with 2 coding questions to be solved.
For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].
Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].
Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].
Interval [10, 12] does not overlap with any interval.
Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
I firstly sorted the intervals based on their second values and then I considered each interval if it overlaps with the previous one or not.
Time Complexity : O(nlogn)
Space complexity : O(n)
A person can also kill himself.
Firstly I tried recursively to fix my position to every place and check if I am remaining till Last to survive. But the Interviewer asked me to do better, then I thought of this question as a circular Linked List where in each step length decreases by one. Then I derived Mathematical formula for the position to survive till last with :
Time Complexity : O(n)
Space Complexity : O(n)
A google Doc was shared with us and we were supposed to write code there.
Use of IDEs was not allowed so we had to write correct code on Google Docs which was later checked by them through online IDEs.
The Interviewer were friendly and observative and helped us through code if we made some silly error.
In the below histogram where array/list elements are {2, 1, 5, 6, 2, 3}.
The area of largest rectangle possible in the given histogram is 10.
Firstly I tried brute force considering all possible left and right pointer and checking what all rectangle areas we can get and taking maximumm from them.
But the interviewer wanted better time complexity than O(n*n)
So I used two arrays Left and right and kept check of next shorter rectangle index to the present one.
This had Time Complexity of O(n) and Space Complexity : O(n)
The interviewer was pleased with this approach
Input: Consider the binary tree A as shown in the figure:
Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.
I made three functions as the order given in Problem statement and did the Traversals in the same way making sure to cover all the edge cases .
This is similar to Preorder/Postorder/Inorder type problems.
Time Complexity : O(n)
The face to face round was held on Google Meet where initially interviewer asked a DS/Algo problem. Later the manager joined and asked about our resume projects in detail.
The time was 10:00 AM.
First I tried brute force approach with taking sum between all left top corner and bottom right corners rectangle formed .
This had time complexity of O(n^4).
Then I brought down the time complexity to O(n^3) by using Kadane's Algorithm and coded it on Docs Shared.
Can you solve each query in O(logN) ?
Firstly I gave the solution of Linear Search but he asked to implement binary search with all corner cases .
So I implemented binary search for finding the number of rotations array has went through.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you create a function in JavaScript?