Tip 1 : Keep it simple
Tip 2 : Limit your resources
Tip 3 : Practise through different websites.
Tip 1 : Link to your projects.
Tip 2 : Open source contribution.
Tip 3 : Clear Tech-stack.
Tip 4 : Link to your different profiles.
Tip 5 : Don't mess up things by writing things you don't know.
Tip 6 : Different Resumes for different job profiles.
Tip 7 : Keep it simple.
No fixed timing(timeslot of around 12 hr)
Environment was stable and time was somewhat less so focus on attending known questions first.
Around 250-300 students were shortlisted



Infix notation is a method of writing mathematical expressions in which operators are placed between operands.
For example, "3 + 4" represents the addition of 3 and 4.
Postfix notation is a method of writing mathematical expressions in which operators are placed after the operands.
For example, "3 4 +" represents the addition of 3 and 4.
Expression contains digits, lower case English letters, ‘(’, ‘)’, ‘+’, ‘-’, ‘*’, ‘/’, ‘^’.
Input: exp = ‘3+4*8’
Output: 348*+
Explanation:
Here multiplication is performed first and then the addition operation. Hence postfix expression is 3 4 8 * +.
Read the Prefix expression in reverse order (from right to left)
If the symbol is an operand, then push it onto the Stack
If the symbol is an operator, then pop two operands from the Stack
Create a string by concatenating the two operands and the operator after them.
string = operand1 + operand2 + operator
And push the resultant string back to Stack
Repeat the above steps until end of Prefix expression.



Read Dijkstra, Prim's and bellman ford algorithm
Timing - 11:00 - 11:45
Interviewer was very helpful




Following is a simple O(n) algorithm to find LCA of n1 and n2.
1) Find a path from the root to n1 and store it in a vector or array.
2) Find a path from the root to n2 and store it in another vector or array.
3) Traverse both paths till the values in arrays are the same. Return the common element just before the mismatch.



Let the price of Ninja Coin for 5 consecutive days is [4, 2, 3, 3, 7].
Then the span of Ninja Coin on the 0th day is 1 because we cannot move backward from day 0.
The span of Ninja Coin on the 1st day is 1 because the price on day 0 is 4 which is greater than 2, so the only day 1 is counted.
The span of Ninja Coin on the 2nd day is 2 because the price on day 2 and day 1 is less than or equal to 3 and then on day 0 price is 4 which is greater than 3, so we count day 2 and day 1.
The span of Ninja Coin on the 3rd day is 3 because the price on day 3, day 2, and day 1 is less than or equal to 3, and on day 0 price is 4 which is greater than 3, so we count day 3, day 2, and day 1.
The span of Ninja Coin on the 4th day is 5 because its value is higher than all previous days values.
Thus you should return an array/list [1, 1, 2, 3, 5].
In this approach, I have used the data structure stack to implement this task.
Here, two stacks are used. One stack stores the actual stock prices whereas, the other stack is a temporary stack.
The stock span problem is solved using only the Push and Pop functions of Stack.
Just to take input values, I have taken array ‘price’ and to store output, used array ‘span’.
Timing: 10:00-10:45



You need to return the head to the doubly linked list.
The doubly linked list would be: 1 2 3 4 5 and can be represented as:

In the following implementation, we traverse the tree in inorder fashion. We add nodes at the beginning of current linked list and update head of the list using pointer to head pointer. Since we insert at the beginning, we need to process leaves in reverse order. For reverse order, we first traverse the right subtree before the left subtree. i.e. do a reverse inorder traversal. It took around 40 mins for me to reach optimum solution.



1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.
2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).
2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.

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?