Tip 1: Practice data structure questions as much as possible. Be confident in explaining your solutions during interviews. For practice, consider using Coding Ninjas.
Tip 2: Research previously asked questions by the company.
Tip 1: Keep it concise. Mention your academic and professional projects. Provide accurate educational details, including your percentage or CGPA obtained.
Tip 2: Include only the information you are confident about in your resume, and continue practising.
3 DSA questions were asked in this round.



Input: Let the binary be as shown in the figure:
Output: Linked List: 15 -> 40 -> 62 -> 10 -> 20 -> NULL
Explanation: As shown in the figure, the right child of every node points to the next node, while the left node points to null.
Also, the nodes are in the same order as the pre-order traversal of the binary tree.
At a node(say cur) if there exists a left child, we will find the rightmost node in the left subtree(say prev).
We will set prev’s right child to cur’s right child,
We will then set Cur’s right child to its left child.
We will then move cur to the next node by assigning cur it to its right child
We will stop the execution when cur points to NULL.



The string only consists of lowercase English alphabets.
2 DSA Questions were asked in this round along with my projects.



For the given binary search tree and k = 3

The 3rd smallest node is highlighted in yellow colour.
Create an empty stack and set the current node to the root of the BST.
Push all the left subtree nodes of the current node onto the stack until the current node is NULL.
Pop the top node from the stack and check if it is the k-th element. If it is, return its value.
Decrement the value of k by 1.
Set the current node to the right child of the popped node.
Go to step 2 if the stack is not empty or k is not equal to 0.



An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.
For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3].
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Can you solve this in linear time and constant space complexity?
Here we use 3 variables called max_so_far, max_ending_here & min_ending_here
For every index, the maximum number ending at that index will be the maximum(arr[i], max_ending_here * arr[i], min_ending_here[i]*arr[i])
Similarly, the minimum number ending here will be the minimum of these 3
Thus we get the final value for the maximum product subarray

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?