Tip 1 : For product Base focus on problem solving
Tip 2 : DSA is must concepts should be clear
Tip 3 : Projects will help you during interview as you will get more time to impress interviewer or ti show your additional skills
Tip 1 : Mention the platform where you have solved questions
Tip 2 : Add some good projects
There were three problems two were based on binary trees and one on kadane's algorithm. You have to solve all of them to get shortlisted for interview
Timing of Test -Day




If root is null or if root is x or if root is y then return root
Made a recursion call for both
i) Left subtree
ii)Right subtree
Because we would find LCA in the left or right subtree only.
If the left subtree recursive call gives a null value that means we haven’t found LCA in the left subtree, which means we found LCA on the right subtree. So we will return right.
If the right subtree recursive call gives null value, that means we haven’t found LCA on the right subtree, which means we found LCA on the left subtree. So we will return left .
If both left & right calls give values (not null) that means the root is the LCA.


Asked me to solve a question related to backtracking , linked list and had a discussion on projects (Reactjs) and oops concepts



Here, sorted paths mean that the expected output should be in alphabetical order.
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1
Expected Output:
DDRDRR DRDDRR
i.e. Path-1: DDRDRR and Path-2: DRDDRR
The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Create a solution matrix, initially filled with 0’s.
Create a recursive function, which takes initial matrix, output matrix and position of rat (i, j).
if the position is out of the matrix or the position is not valid then return.
Mark the position output[i][j] as 1 and check if the current position is destination or not. If destination is reached print the output matrix and return.
Recursively call for position (i+1, j) and (i, j+1).
Unmark position (i, j), i.e output[i][j] = 0.

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?