Tip 1 : Practice DSA problems as much as you can
Tip 2 : Always focus on the quality of problems compared to the quantity of coding problems
Tip 3 : Practice puzzle problems, and brush up on your System Design fundamentals
Tip 1 : Try to mention the GitHub links to all projects and to all your coding profiles.
Tip 2 : Make sure to write the project description in bulletin point and also mention the impact in terms of quantifiable value.
It was a 1 hours Hackerrank coding test, and I have been given 24 hours to attempt the test. There was 2 Medium to Hard coding questions, and the topics were from Graphs, Trees.


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
1). First make a queue of pair of coordinates
2). Insert all those coordinates where value is 2
3). Run BFS on 2D Grid
4). Then run a while loop and correspondingly make the movement from one cell to another only if value at next cell is 1 and the movement doesn't cross matrix boundaries and then make that value to 2, and corresponding increase the time value by 1 in each loop.
5). At the end, if we are left with atleast cell where value is 1 then return -1, else return time.



A leaf of a Binary Tree is the node which does not have a left child and a right child.
Given a binary tree :

All the root to leaf paths are :
1 2 4
1 2 5
1 3
1. Two nodes may have the same value associated with it.
2. The root node will be fixed and will be provided in the function.
3. Note that the nodes in a path will appear in a fixed order. For example, 1 2 3 is not the same as 2 1 3.
4. Each path should be returned as a string consisting of nodes in order and separated by a space.
5. The path length may be as small as ‘1’.
1). I used recursion here to generate all root to left paths of the given Binary Tree.
2). The base condition for this recursive function was when we hit the leaf node, we need to check whether the sum equals to targetSum, if yes then insert the path vector into the answer.
3). Once you traverse the whole binary tree, you'll get your resultant root-to-leaf nodes.
It was a medium-level round, where two DSA Questions were being asked.



1) A string is valid only if every left parenthesis has corresponding right parentheses in the same order.
For example Given ‘STR’ = (())()) is not a valid string, whereas ‘STR’ = (())() is a valid string.
1). Here, l used a stack for checking the validity of parentheses, and later remove the indexes of invalid parentheses from the string s.
2). First, iterate the string s and mark the index of those characters which need to be removed to make it parentheses string using a special symbol '#'.
Here, a stack is used for finding the valid pair of parentheses, and while doing so also mark the indexes of invalid parentheses in s.
3). Finally, iterate s again and append non-marked symbol (#) to ans.



1). Here, we hash the indices of all elements in a hashMap. In case of repeated elements, the last occurrence index would be stored in hashMap.
2). Here also we fix a number (num[i]), by traversing the loop. But the loop traversal here for fixing numbers would leave the last two indices. These last two indices would be covered by the nested loop.
3). If the number fixed is +ve, break there because we can't make it zero by searching after it.
Make a nested loop to fix a number after the first fixed number. (num[j])
4). To make sum 0, we would require the -ve sum of both fixed numbers. Let us say this required.
Now, we will find the this required number in hashMap.
5). If it exists in hashmap and its last occurrence index > 2nd fixed index, we found our triplet. Push it in answer vector.
6). Update j to last occurence of 2nd fixed number to avoid duplicate triplets.
7). Update i to last occurence of 1st fixed number to avoid duplicate triplets.
8)> Return answer vector.
1 DSA Question and Fundamentals of System Design are being asked. Discussion on my Projects.



1). I used the Recursive here.
2). If current node value is greater than low, and less than right, then update the left and right child node of cur node by calling the recursion function for their left and right child individually.
3). If current node value is less than low, then call recursive function for right child.
4). Else call recursive function for left child.
Tell the difference between SQL and NoSQL, when to use them. And have you used any of them in the previous projects. (Learn)
Tip 1 : Understand the problem and think rationally taking into consideration the trade-offs that you would be making in choosing the one than the other.
Tip 2 : Always speak it out loud and make sure that you and the interviewer are on the same page.
Tip 3 : Always asked and clarify the requirements from the interviewer beforehand.
Here, the interviewer asked about different questions to know more about me, and why I wanted to join PayPal.

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