Tip 1 : Practice Atleast 250 Questions on Leetcode
Tip 2 : For DSA questions in interviews, start explaining from the brute force approach and then move to the optimal one. Convey your thought process to the interviewers, so that they can help you out if you get stuck.
Tip 3 : Do not write anything that you are not confident of in resume
Tip 4 : Do atleast 2 projects
Tip 1 : Try to include at least one development project in your resume.
Tip 2 : Interviewer will ask anything from your resume so be prepared for it.
Tip 3 : Don't mention some random projects which you are not sure about or copied from Google or somewhere else.
Aptitude + Technical Mcq Test + Coding Round on Mettl Platform






I used Dynamic Programming :-
In this method, we build jumps[] array from right to left such that jumps[i] indicates the minimum number of jumps needed to reach arr[n-1] from arr[i]. Finally, we return jumps[0].



1. The array can have duplicate elements.
2. Each of the array elements must belong to exactly one of the 'K' subsets.
3. The elements chosen for a subset may not be contiguous in the array.
We can solve this problem by computing modulo of array numbers with K. if sum of two numbers is divisible by K, then if one of them gives remainder i, other will give remainder (K – i). First we store frequencies of numbers giving specific remainder in a frequency array of size K. Then we loop for all remainders i and include max(f[i], f[K – i]). Why? a subset with no pair sum divisible by K must include either elements with remainder f[i] or with remainder f[K – i]. Since we want to maximize the size of subset, we pick maximum of two sizes.
In below code array numbers with remainder 0 and remainder K/2 are handled separately. If we include more than 2 numbers with remainder 0 then their sum will be divisible by K, so we have taken at max 1 number in our consideration, same is the case with array numbers giving remainder K/2.



Let’s say the array ‘A’ = [1, 2, 3, 4, 5], then after merging indexes 2 and 3, the array ‘A’ will look like [1, 5, 4, 5].



There are two possible scenarios when a turn can occur at point (i, j):
Turns Right: (i - 1, j) -> (i, j) -> (i, j + 1)
Turns Down: (i, j-1) -> (i, j) -> (i+1, j)
It was a technical interview round where I was asked questions based on DSA.



In the given linked list, there is a cycle, hence we return true.

Floyd’s Cycle-Finding Algorithm
1. Traverse linked list using two pointers.
2. Move one pointer(slow_p) by one and another pointer(fast_p) by two.
3. If these pointers meet at the same node then there is a loop. If pointers do not meet then linked list doesn’t have a loop.



Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.

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?