Tip 1 : Practice questions on online platforms
Tip 2 : Understand the best solutions in depth and algorithm used
Tip 3 : Ask clarifying questions to the interviewer and break the problem to smaller sub parts
Tip 1 : Highlight your most impactful work on the resume
Tip 2 : Keep it easy to understand
Given an array, check whether it is possible to get two numbers from the array with sum k.(the easy-this question is asked just for comforting purposes)



Solved it using BFs



Using two pointers and swaping nodes
This round is also based on DSA. 3 questions were asked.


For a (6 x 6) board, the numbers are written as follows:

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder. Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.
For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2 [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.
A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
I solved it using graphs



Input: 's1' = "abcd", 's2' = "anc"
Output: 3
Explanation:
Here, 's1' = "abcd", 's2' = "anc".
In one operation remove 's1[3]', after this operation 's1' becomes "abc".
In the second operation remove 's1[1]', after this operation 's1' becomes "ac".
In the third operation add 'n' in 's1[1]', after this operation 's1' becomes "anc".
Hence, the minimum operations required will be 3. It can be shown that there's no way to convert s1 into s2 in less than 3 moves.
A simple approach is to consider all subsequences of str1 and for each subsequence calculate minimum deletions and insertions so as to transform it into str



1. Text form of ‘IPAddress’ must be ‘a.b.c.d’
2. The values of a,b,c and d can vary from ‘0’ to ‘255’ and both ‘0’ and ‘255’ are inclusive.
We will check all the cases where IP address may be invalid
1. First we will split the given input using split() function then check if it has a length of 4 or not .If length is not equal to 4 then we will directly return 0.
2. In second step we will check if any split element contains any leading zero or not .if it is then we will return zero.
3. If any of the split does not contain any number then it is not a valid IP address .so we will return 0
4. Then we will check if all the splits are in the range of 0-255 or not .If not we will return 0.
5. Finally if none of the above condition is true we can finally say that it is a valid IP address and we will return True.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you create a function in JavaScript?