Tip 1 : Be confident in what you answer. It's never necessary to give the best solution on the first try. You should come to the final answer constructively.
Tip 2 : Study your resume thoroughly. You should know the details of what you have done and related topics.
Tip 3 : Practice DSA enough to be on a stage where you can create solutions of your own, be it any level
Tip 1 : Keep it crisp and add details that are relevant to the job you are applying for.
Tip 2 : Try to add the latest working projects with live links so that you can show the proof & working of your awesome work.
It was a medium-level round with 3 DSA questions.






Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

And chocolates in each packet is : {8, 11, 7, 15, 2}
All possible way to distribute 5 packets of chocolates among 3 students are -
( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
It can be solved with Backtracking but the ideal way is to use Binary Search.



It was scheduled after lunch and was mainly focused on medium DSA problems & Resume Overview



nodes, where the nodes have integer values.
For the given binary tree:

The Inorder traversal will be [5, 3, 2, 1, 7, 4, 6].
The Preorder traversal will be [1, 3, 5, 2, 4, 7, 6].
The Postorder traversal will be [5, 2, 3, 7, 6, 4, 1].
First I used recursion to solve this problem.
Then when asked to optimize the solution
Then I used the stack solution which was better


For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
1
/ \
2 3
/ \
4 5
Output: 1 3 2 4 5
I told him about the recursive solution.
But then the interview asked me for a better solution
I used a dequeue to solve this problem



I created a DFS solution using an extra visited matrix.
The interviewer asked me to use constant space.
I used in place value modification to traverse the matrix and came up with the solution
It was scheduled in the evening when we discussed a low-level system design problem. The interviewer was very helpful and guided as I came up with a solution.



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.
Tip 1 : Try to think of all the variables and methods first before getting to the code part
Tip 2 : When implementing these functions, think like you are actually using the game and solutions will come to you.
Tip 3 : Choose good variable & method names as they will help you to implement and it looks very impressive.
Tip 4 : Don't be afraid to take guidance from the interviewer. They want you to come up with a solution so they will definitely guide you.
Technical Discussion on my Resume & Skills
It was mainly around my projects, past internships & experience.
Tip 1 : Be confident & answer all questions with utmost sincerity.

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