Tip 1 : Improve your problem-solving skills from the start only and do competitive coding.
Tip 2 : Try to expertise DS Algo for Product based companies.
Tip 3 : Work on small projects to explore the real scenario of product development.
Tip 4 : Learn how to make an effective resume and prepare according to your resume.
Tip 1 : Make 1 Page Resume mentioning your achievements in a quantitative manner.
Tip 2 : Participate in the renowned contest e.g. Google Kickstart, Google Hashcode, Google Codejam, Facebook Hackercup and mention their ranks.
Tip 3 : Do small projects and mention them. Prepare their application, future score and challenges faced.
The First Round comprised of 3 Programming Problems (90 minutes) mainly based on Competitive Coding. It was on Mettl Platform.
There were different sets of problems.
I solved all 3 problems completely in approx 45 minutes. 130 students were registered for this round and 122 attempted and 70 qualified for next round. The qualified list was quite strange few students who solved 1, 2 problems completely were not qualified and few solving all 3 problems partially qualified for next round.


Let’s consider the equation X^2 + 2X + 1 = 0 . We can see that the quadratic equation has no real roots. So we return a pair of -1 i.e. [-1, -1].
1. If the equation has repeated roots, return the roots twice.
2. If there are imaginary roots, return -1 twice.
3. If the root is not an integer, return the greatest integer value less
than the root.
I used the formula (-B +- root(B^2-4*AC))/2*A
to get roots then now for rounding up to 3 decimal places.
Let say roots are
double r1 and double r2
Now for rounding up to 3 decimal places
r1 = round(1000*r1)/1000
similarly for r2
As round function in CPP only round to nearest
integral
then finally return r1 and r2



A character from an index of a string(str1) is put at the end of it, is defined as a single operation.
You cannot perform any operation on the string, str2.
This problem was also revolved around some story but soul idea was there were several intervals given in form l to r. We need to merge the intersecting intervals and tell the number of intervals left after merging. Eg. (1, 5), (9, 15), (2, 6), (7, 8) answer will be 3 as we will have (1, 6), (7, 8), (9, 15).
I first sorted the intervals in ascending order of 'R' then I traversed the intervals from left to right keeping the endpoint of the last interval and checking if it's intersecting with new interval or not and updating answer accordingly.
This was the group fly round and there was a problem-related to algorithm design to manage an Airport considering all the constraints of the Airport given by them. There were 3 sections of the problem Algorithm, Data Structures Used, Test case scenarios.
26 students qualified for next round out of 70.
This was the first Technical Round.
It revolved around Resume, Projects, Problems Solving and OOPS.
First He asked me to tell me about yourself. I told him that I love to do CP and I was having good achievements in my CV related to CP. But he hasn’t asked anything related to CP.
He told me to pick any one of your projects and explain it to me. I explained to him thoroughly and he asked a few doubts and I cleared them and it went good. Then he asked me to pick one more project and explain it to me. This also went the same as earlier. I was having a total of 5 small projects.
Then he asked me that do you know OOPs. I said I will be having this subject in my current semester but I studied by myself. So he asked me to explain inheritance. I explained with an example. He told me to write code in any language. He then asked me that can we inherit a protected or private member of a base class as a public member in child class. He asked me the meaning of inheriting with different classifiers like public, protected, private and asked about the reason behind that. I was not so sound on OOPs so I gave my answers with disclaimer that I am not so sound in OOPs.



Order of return of diagonal path’s array/vector: The rightmost diagonal path must come first, and so on.
Every parent node comes first then the child node. In other words, return the diagonal element from top to bottom.
Consider the given binary tree.

There are 4 diagonal paths:
1 3 6
2 5 9
4 8
7
You need to return ‘1 3 6 2 5 9 4 8 7’.
Let's consider this example

Diagonal paths are:
1 3 6
2 5
4
You need to return ‘1 3 6 2 5 4’.
This was the second technical Round.
This time I got a female interviewer and she was more friendly, she was already impressed by my achievements of competitive coding. She said you have so many achievements So, you will have difficult problems. I said I will try my best.

Let the sequence be 1, 4, 5, 6, 7 then return 14 5 4 5 14 i.e when 1 is the root node the number of BSTs possible is 14. Similarly, when 4 is the root node the number of BST’s possible is 5. In a similar way, we calculate the number of BST’s possible for the remaining elements of the sequence.
1. Consider 0 based Indexing.
2. A Binary Search Tree is a special kind of tree in which each node of the tree has at most 2 children and for every node, the value of nodes of the left subtree of any node is less than the current node and value of nodes of the right subtree are greater than the current node.
I tried solving the problem using recursion ignoring the constraint of even numbers. So I was able to figure out the DP relation of Catalan number. Then I observed that we can only keep the numbers greater than greatest even number on root and rest we can use our Catalan number observation to get the final answer. She didn't ask me to code, she was fine with approach only.



I answered all the possible ways. She also asked me to determine which number is greater among 2 numbers using Bitwise Operators. I was thinking about that problem and I was not able to find anyway and she interrupted and said it’s okay I also forgot small things.
Next, she jumped to my very small project of Line Following Bot and we discussed it’s working.




knightPosition: {3,4}
targetPosition: {2,1}

The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the ‘stepCount’ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and ‘stepCount’ becomes 2 which is the final answer.
1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).
2. The knight can make 8 possible moves as given in figure 1.
3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).
I explained the solution but she asked me is it possible to do it with DFS? and Why BFS? why not DFS? I explained her the approach from both perspective and proved BFS is better.
She said I think it’s already been 40 minutes, So I should leave you and she asked me to ask questions to her. I asked her that we learn these DS and Algo. How we are going to use these in real-life projects. She said now you have raised problems for yourself, I will ask you 2 more questions. The whole conversion was very light and friendly. She asked problems related to developing products.
She asked me to make an ATM, that was a simple implementation taking care of some constraints. Then she asked me to design an algorithm for TinyURL conversion from normal URLs and vice-versa. I explained solutions using a polynomial hash. PS. she just wanted to hear the solution. I don’t have to code these problems.
She directed these solutions and said she this is how you use DS Algo in developing products and that’s All.
We were having this round over video conferencing with HR over Microsoft Connect over laptops.
He first explained that your technical skills will not be assessed in this round.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?