Tip 1 : We should focus on other topics apart from DSA. Knowledge of LLD, HLD, OOPS and other subjects also plays a very important role.
Tip 2 : Communication also plays a key role in interviews. We should be able to explain our solution precisely and also able to catch hints given by Interviewer.
Tip 3 : While practising DSA focus should be on logic building rather than cramming the solution because proper reasoning will hep you to solve other new questions.
Tip 4 : Always remember interview is two way communication.
Tip 1 : Mention only those projects and skills in which you are confident.
Tip 2 : Resume should be of one page(preferrable).
Basically a hackerrank link was shared and I was suppose to take the test within a day. Online Test comprised of 3 algorithmic Questions. Duration of round was 90 minutes.



I first tried to solve the problem using BackTracking and was able to pass only 8 test cases out of 13. Then I checked the constraints again and realised that for clearing all 13 test cases I have to submit a solution with worst time complexity O(n^2). I tried to solve the question again but due to limited time couldn't solved it completely.



[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
I read the question first and the constraints. After reading the question I wrote the recurrence relation on paper and verified with the help of some examples. After verifying the recurrence relation, I coded the memoized solution and was able to pass all test cases.
It was a 60 minute virtual face 2 face round with 2 senior software engineers of the company. Interview started with brief introduction by the engineers followed by my Introduction. Interview started at 3:00 P.M and lasted till 4:10 P.M. Google Doc was used for coding purposes.



Can you solve each query in O(logN) ?
1. I first solved the problem with brute force i.e using linear search. Complexity of solution was O(N) . Interviewers asked me to optimise more.
2. Then I used the fact that initially array was sorted , so I started thinking in the direction of binary search and was able to propose a solution with O(NLogn) Complexity.
3. Then Interviewers asked me about the explanation of the solution and I was able to tell them correctly. Interviewers were satisfied with my solution


For the parent array {1, -1, 1}, the tree will be:-

As, parent of 0 is 'PARENT'[0] i.e. 1.
1 is the root as 'PARENT'[1] = -1.
Parent of 2 is 'PARENT'[2] i.e. 1.

From the parent array, multiple binary trees may be possible. You have to create a binary tree in such a way that these conditions satisfy:-
If the node has a left child as well as a right child, make sure the left child is smaller than the right child.
If the node has only one child, make sure it has an only left child.
For {1, -1, 1}, the accepted tree will be:-

And for {1, -1}, the accepted tree will be,

Instead of

1. Read the questions and constraints carefully.
2. Came to conclusion that I have to find the height of binary tree represented by parent arrary.
3. Coded the solution while keeping the corner cases in mind.
It was a face 2 face algorithmic round taken by Senior Backend engineer. Interview Round Started at around 2:00 P.M and lasted till 3:05 P.M. Interview started with the brief introduction followed by 2 algorithmic questions. Interviewer was focusing problem solving skills. After discussing the approach, Coding part was to be done on google doc.



Down: (row+1,col)
Down left diagonal: (row+1,col-1)
Down right diagonal: (row+1, col+1)



Can you solve this using not more than O(S) extra space, where S is the sum of all elements of the given array?
1. Initially I wasn't able to come up with solution then I thought of brute force solution.
2. I focused on solving with brute force and solved the problem with brute force i.e using Backtracking. Complexity of solution was Exponential . Interviewer asked me to optimise more, since solution was of exponential time complexity.
3. Then I used the fact that if sum of entire array is even then only we can divide the array into two parts. With the help of this logic I optimised my solution a bit more.
4. I wasn't able to provide the most optimised solution.
5. Since I was optimising my previous solutions Interviewer was happy with my approach of slowly building the solution .
It was a face 2 face round which was taken by Line manager. Interview started at 11:00 A.M and lasted around 2 hours approx. Interviewer was very friendly and supportive. Interview started with brief introduction of the interviewer followed by mine. Then a System design question was asked by the interviewer over google doc. Interviewer was focusing on how I'm approaching the problem. Overall It was a good experience.
Build Search Functionality, for a Hotel booking system like OYO, which should results in relevant search result based on User query. Constraints were as follows:-
1. User Query can be anything.
2. Hotel Records/Data can be Huge.
3. Have to respond with relevant search result even if user query is not correct. Have to respond with closest relevant result.
Schema of Data:-
Hotel ABC,
Name: 1, Hotel ABC, 2. Hotel XYZ.
Description: 1. 100 character -> “5 star hotel….”
Geo {
India
Asia
}
Facilities (upto 10) [
Swimming pool,
Free Lunch.
].
Following Important Questions were asked during the discussion of this problem.
Q:-1. How do you divide your data?
Q:2. how do we do a best relevant search for hotel product.
Q:3. How do you store the data?
Tip 1 : Clarify each and everything with the Interviewer.
Tip 2 : Don't assume anything.
Tip 3 : You should be able to reason your decision of choosing one thing over another. Answering without any reasoning is a red flag .
Tip 4: This resource really helped. https://github.com/donnemartin/system-design-primer

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 return keyword?