Tip 1 : Have in-depth knowledge of at least one OOPs-based language and practice DSA.
Tip 2 : Prepare for questions on your projects and at least 1 project is a must.
Tip 1 : Avoid putting false stuff in resume
Tip 2 : Have a good project and try to mention your coding profiles
It was a Data Structure round which consisted of 2 coding questions of medium difficulty.


Input: Initial Linked List: 1 -> 5 -> 2
Output: Modified Linked List: 1 -> 5 -> 3
Explanation: Initially the number is 152. After incrementing it by 1, the number becomes 153.
I gave the interviewer two approaches to solve the problem recursive approach/ reversing the LinkedList and adding 1 and then reversing that back.
He asked me to code out the recursive approach that I did and ran over test cases given by him and that worked.
Simple recursion would help
Just there's an edge case where if 9 is the number then adding 1 will need to be 1->0 so you will need to create new node



Can you solve each query in O(logN) ?
Instead of two or more passes of binary search the result can be found in one pass of binary search. The binary search needs to be modified to perform the search. The idea is to create a recursive function that takes l and r as a range in input and the key.
Interviewer was good and was helping by giving proper hints


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
This is a standard algorithm multisource bfs using queue



Create two pointers and traverse the linked list from both ends. At every step swap nodes by interchanging the links of the nodes
This was the CTO Round has good discussion with the CTO



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.
Implemented this using python dictionary by initiating that with values like {99:3, 10:30} and just generate random number (dice) and 1 to 100 if counter reaches 100 game stops else roll dice and check the number in the dict for snake or ladder.

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