Tip 1 : Your basics should be very clear about data structures and algorithms.
Tip 2 : Try to solve questions in a specific time frame. Also dry run your code with custom test cases, try to find the edge cases.
Apart from this try analyzing the time and space complexity of your solution.
Tip 3 : Take a look at editorials after solving the questions as it can give you a better approach to the problem.
Tip 4 : Don't neglect subjects like OOP's, DBMS and OS. Interviews ask few questions from here as well.
Tip 1 : not too short or too long
Tip 2 : scale up the basic technologies in resume
Round was scheduled in the evening within a window of two hours.
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
knightPosition: {3,4}
targetPosition: {2,1}
The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the ‘stepCount’ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and ‘stepCount’ becomes 2 which is the final answer.
1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).
2. The knight can make 8 possible moves as given in figure 1.
3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does ROLLBACK do in DBMS?