Tip 1 : Don't go for the number of questions....go for the quality of questions while doing DSA
Tip 2 : Make detailed notes as placement season is a long period you'll keep forgetting what you did a month back
Tip 3 : Prepare company specifically for at least a week before the interview.
Tip 1 : Use quantifiers as much as possible in projects and internships
Tip 2 : Mention some co-curricular activities as well like College societies etc.
It was a subjective Coding round with 3 DSA questions to be solved in 180 mins time. 2 Sample test cases were given to test the code before submitting and 10-12 hidden test cases were there.There was partial marking also if a candidate is able to pass 3-4 test cases rather than all.



An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.
For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3].
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Can you solve this in linear time and constant space complexity?
So we basically use the Kadane's algorithm to solve this problem.
Step 1: Make two variables max_ending_here min_ending_here, max_so_far
Step 2: Make the following Calculations for each element in the array
maxhere = Math.max(Math.max(maxherepre * A[i], minherepre * A[i]), A[i]);
minhere = Math.min(Math.min(maxherepre * A[i], minherepre * A[i]), A[i]);
maxsofar = Math.max(maxhere, maxsofar);
maxherepre = maxhere;
minherepre = minhere;
Step 3: return max_so_far



1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.
The basic idea is every time we start from a station, we go as far as possible by increasing the end until the remaining gas is less than 0. If 'end' finally hits start we know we can travel around from 'start'. If we haven't traveled around, we know we cannot start from this station. Then we check the station before our start station if we can start from this station. Repeat until we have checked all stations.
Note there is a little trick that every time we try to find the next start station, we always go back to extend the distance from start to end so that we can check all stations on the circuit. Otherwise, if we move start forward to decrease the distance from start to end, we are likely to end up only checking part of the circuit. Another trick is we start from the end of the array so as to avoid some corner cases.


the basic idea is, keep a hashmap which stores the characters in string as keys and their positions as values, and keep two pointers which define the max substring. move the right pointer to scan through the string , and meanwhile update the hashmap. If the character is already in the hashmap, then move the left pointer to the right of the same character last found. Note that the two pointers can only move forward.
I was a face to face interview with a specialist programmer in Infosys. 1 DSA question was asked and a detailed discussion on my resume, skills, projects and previous internships was there.



1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
So this a multi-source BFS problem where we need to apply the BFS algorithm.
First, count fresh oranges. Then, until fresh is non-zero, perform BFS to rot oranges, decreasing fresh. Count days (d) and return it in the end. If, after another day, fresh does not change, return -1.
For BFS, we can use the day counter (d + 2) to only process oranges that rotted yesterday.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: