Tip 1: Practice problems regularly.
Tip 2: Participate in contests.
Tip 3: Attend mock interviews.
Tip 1: Have projects.
Tip 2: Mention all your achievements.
It was a 3-hour assessment conducted in the morning, divided into sections.

An integer has a monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.
Given ‘N’ = 987
The answer is 899 because that is the greatest monotone increasing number possible that is less than ‘N’.
Step 1: I observed that only adjacent elements matter, so I used a simple loop.
Step 2: For every pair, I calculated:
d = A[i+1] - A[i]
Step 3:
If d > Y, upward movement fails.
If -d > X, downward movement fails.
Then I immediately returned:
2 * (i + 1)
Step 4: If no failure happens till the end, I returned:
N + 1


Consider an array of size four. The elements of the array are { -4, 5, 6, 1}.
The value of K is 4.
The subarrays whose sum is divisible by 4 are as follows:
[ -4 ]
[-4, 5, 6, 1]
[ 5, 6, 1]
Hence, there are three subarrays whose sum is divisible by 4.
Step 1:
Initialize a hashmap to store the count of each divisor.
Step 2:
For each number in the array:
Find all its divisors using loop from 1 to sqrt(num)
For each divisor d:
Increment count of d
If d != num/d, increment count of num/d
Step 3:
Now iterate over all divisors stored in hashmap.
Step 4:
For each divisor K:
If it appears in at least 2 elements:
total = K * count
Update maximum result.
Step 5:
Return the maximum value.
We were asked to solve one problem out of the given set. Around 1 hour was allotted for this. Later, a 30-minute discussion was conducted on projects, achievements from the resume, and questions on computer science fundamentals.



1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.
Step 1: Understand the Mapping
Each gas station points to exactly one other gas station using g[i].
So this behaves like a directed graph where:
Node = gas station
Edge = i → g[i]
We need distance of every node to station 1.
Step 2: Brute Force Idea
For every station:
Start from that station
Keep moving using g[i]
Count steps until reaching station 1
But this repeats calculations many times.
Time Complexity:
O(n2)
This is too slow for n = 10^5.
Step 3: Optimize Using DP / Memoization
If we already know the time for one station, reuse it.
Example:
5 → 3 → 2 → 1
If C[3] = 2, then:
C[5]=1+C[3]=3
So:
C[i]=1+C[g[i]]
Base case:
C[1]=0
Step 4: DFS / Recursion with Memoization
For each station:
If already computed, return stored answer.
Else compute recursively:
C[i] = 1 + C[g[i]]
Then sum all values.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does the SQL function NOW() return?