Tip 1: Know what to prepare for; go on LinkedIn to find jobs you would apply for. Understand the skills required and plan for 5-6 months to reach that goal.
Tip 2: Don't waste time in college; get going with a few good seniors and discuss with them what you want to become and how to achieve that.
Tip 3: Campus placements and internships are essential in these uncertain times. If you graduate without any internships or campus placement, there is no incentive for any company to give you a chance as a fresher.
Tip 1: Use an ATS-friendly resume. There are a few ATS tools (some free, some paid) that give your resume a score and list points to improve it.
Tip 2: List only relevant experiences.
Tip 3: Your LinkedIn profile matters. Make sure it is well-crafted.
Round started with a discussion about my journey in computer science & my current roles & responsibilities at Sprinklr.
Simple Java questions were asked regarding the Collection framework & Simple OOPS concept
Then we moved ahead to the Algorithmic Problems


An edge with type 1 can only be traversed by a person ‘A’.
An edge with type 2 can only be traversed by a person ‘B’.
An edge with type 3 can be traversed by both persons ‘A’ and ‘B’.
At first, I tried to think of a brute force approach in which we would try to explore each & every path from source to destination & reverse every edge that comes in the way.
While explaining the algorithm it hit me that this is somewhat like Dijkstra's algorithm.
Whenever we are at any node we can consider the outgoing edge to be of weight 0 & incoming edge to be of weight 1.
& the number of edges we would need to reverse in the process would be the same as the cost of reaching the destination from the source in Dijkstra's algorithm.
The interviewer was happy with this approach & I was told to code it out on a Google Doc
I did that & proceeded to the next question.



You are given ‘ARR’ = [5, 2, 3]
In the first step, you can change 5 to 3, so the new array is [3, 2,3].
In the second step, you can change the 3 to 2, then the array is [2, 2,3].
In the third step, you can change the 3 to 2, then the array is [2, 2, 2]
Hence the answer is 3.
I had solved this problem beforehand while practising & had a little time left to solve this question in the interview so quickly I went to the solution.
This is a basic DP problem.
Maintain a 2D dp matrix of size (row, column) where each i, and j shows the minimum steps required to reach the end of the matrix
Start from the bottom right corner and fill the last row & last column using the (i, j+arr[i][j]) or (i+arr[i][j], j) rule.
Now start from row - 2->0 & column - 2->0 & start filling the dp matrix in reverse order.
(Avoid going out of the bounds of the matrix).
The Round started with a discussion about my journey in computer science & my current roles & responsibilities at Sprinklr (Same as the previous round).
Then we moved directly to the problem-solving



I knew about its other variation House Robber 1 in which houses were lined up straight.
So I started thinking in that manner only but the catch was that we cannot rob 0th & n-1th house
The simple approach that hit me was -
Remove the first & the last house
Therefore, the core idea is to apply dynamic programming. Two cases are considered here:
When you rob the first house
When you don't rob the first house, i.e. you rob the last one.



A string ‘B’ is a substring of a string ‘A’ if ‘B’ that can be obtained by deletion of, several characters(possibly none) from the start of ‘A’ and several characters(possibly none) from the end of ‘A’.
Two strings ‘X’ and ‘Y’ are considered different if there is at least one index ‘i’ such that the character of ‘X’ at index ‘i’ is different from the character of ‘Y’ at index ‘i’(X[i]!=Y[i]).
This was a tricky problem
First I tried a brute force approach in which I made a graph.
Any number Ex - 239 has an outgoing edge to every number starting with 9 & an Incoming edge from every number starting with 2.
Now after making this graph we just have to find the largest cycle in this graph.
The interviewer stopped me here & asked me about the time complexity
O(n^2) I said.
However, the interviewer said to reduce the time complexity.
I took a few minutes & thought that we don't need to store the whole string of number
We just need its first & last digit
I build a 2D matrix of size 10*10
any index i,j represents a number or the maximum length of a number starting with I & ending in j.
Now whenever a number ex - 891 comes.
We already have the data of all the numbers before it ends with 8 (starting with 1, starting with 2 etc....)
Now for index (1, 8) (2, 8), (3, 8) etc., we form a 9 numbers
starting with 1 & ending with 1 (last digit of 891)
starting with 2 & ending with 1 (last digit of 891)
& so on.
thus updating the (1, 1) index (2, 1) index & so on.....
After iterating over all the given numbers we will find the maximum value present in the diagonal (i, i) to get the answer.
Directly started with the Problem-solving.



Can you solve each query in O(logN) ?
The first step of course is to find out the actual sorted order with their position.
Then
Assume we have to collect any number say 8 whose first occurrence is at index 3 to index 9 & we are at position 6. There are 2 options now -
1) Go to position 9 collecting all 8s & then to position 3
2) Go to position 3 collecting all 8s & then to position 9
Now start from there & move to the next greater number
So simply at every step/number we have 2 options & hence it became a 2 power n kind of approach that can be converted to a 2dp problem.
& I proceeded with that
It took me a lot of time so got a little anxious about the next question.



[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?