Tip 1 : Practice at least 250 DSA Questions.
Tip 2 : Do at least 2 good projects.
Tip 3 : Don't fake the resume. Write everything which is true in your resume.
Tip 4 : Computer Science Fundamentals is also very important.
Tip 1 : Have at least 2 good projects on your resume.
Tip 2 : Do not fake the resume.
It was online Coding and MCQ round consisting of 2 medium-level coding questions and 18 MCQs.
Timing - Can be given anytime as it was online.
Subsequences of string "abc" are: ""(empty string), a, b, c, ab, bc, ac, abc.
Step 1: Since this is a Dynamic Programming problem So the first approach I have explained is the recursive approach.In which we can break the problem into subproblems.
Step 2: It was not working for all test cases.
Step 3:So I tried to optimize it with Memoization.
Step 4: It worked for all Test Cases.
‘MEETINGS[]’ = {30, 15, 60}
Let us assume the meeting starts at 12:00 o’clock.
The first meeting takes 30 minutes so after the first meeting time is 12:30.
Then Ninja cannot attend the second meeting which is for 15 minutes because he needs 15 minutes break after every meeting.
After a 15 minutes break, he can attend the next meeting which is for 60 minutes.
So the total booked minutes for the meetings is 30 + 60 = 90.
Step 1: Since it is the Greedy Problem So firstly I created a vector of 3 items start time, end time, and meeting number, and sorted this using comparator based on ascending order of end time.
Step 2: We need a variable to store the answer. Initially, the answer is 1 because the first meeting can always be performed. Make another variable, say limit that keeps track of the ending time of the meeting that was last performed. Initially set limit as the end time of the first meeting.
Start iterating from the second meeting. At every position we have two possibilities:-
If the start time of a meeting is strictly greater than the limit we can perform the meeting. Update the answer. Our new limit is the ending time of the current meeting since it was last performed. Also update the limit.
If the start time is less than or equal to the limit, skip and move ahead.
This way this code was passing all test cases
It was 30 minutes interview in which the interviewer firstly ask the introduction question then about the projects and internships and finally the Data Structures and algorithms question and then some general CS Fundamentals questions. The interviewer was very friendly and amazing.
If the given matrix is:
[ [1, 2, 5],
[3, 4, 9],
[6, 7, 10]]
We have to find the position of 4. We will return {1,1} since A[1][1] = 4.
Step1: I first told him the brute force which is direct for this problem, but of course, he was not satisfied.
Step 2: We map the indices of matrix elements to a 1D array as follows :
If we copy the elements of a matrix (say ‘MAT’) to an array (say ‘ARR’) in a row-wise manner, then the element ‘MAT[i][j]' is equal to ‘ARR[N*i+j]’, where ‘N’ denotes the number of columns in ‘MAT’.
Similarly, converting ‘ARR’ back to ‘MAT’, the element ‘ARR[i]’ is equal to ‘MAT[i/N][i%N]’ as ‘ARR’ contains M*N elements, so ‘rowNum’ is equal to i/N and ‘column' is equal to i%N.
Step3: After this approach he was satisfied.
It was a normal HR discussion round in which HR asked me about some general questions and then he told me at the end that I got selected.
He asked some HR Questions.
Tip 1 : In this round communication is very important.
Tip 2 : Doing the top 20 HR Questions from any website is sufficient for this round.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is the purpose of the < title > tag in HTML?