Tip 1 : Focus on DS/algo
Tip 2 : Learn manual testing scenarios
Tip 1 : Mention experience and skills
Tip 2 : Mention certifications
The interviewer asked me 2 questions related to DS/Algo in this round. Both the questions were of Easy-Medium difficulty and I was also required to code them in a production-ready manner.



1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order.
2. The elements in the array need not be distinct.
3. If no such triplet is present in the array, then return an empty list, and the output printed for such a test case will be "-1".
Find the sum ‘sum_of_elements’ of all the numbers in the array. This would require a linear scan, O(n).
Then find the sum ‘expected_sum’ of first ‘n’ numbers using the arithmetic series sum formula i.e. ( n * (n + 1) ) / 2.
The difference between these i.e. ‘expected_sum - sum_of_elements’, is the missing number in the array.



Input: Let the binary tree be:

Output: [10, 4, 2, 1, 3, 6]
Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
As we know that all three traversals, i.e. pre-order, in-order and post-order, visit the tree node at once. We can use any of them. Here we are going to use pre-order traversal for the explanation. So while traversing in the pre-order traversal, we will keep track of the horizontal distance of the node which is going to be visited from the root node, and we also keep track of the vertical level of that node (where the vertical level of the root node would be ‘0’ and its children would be ‘1’ and so on.... ).
1 coding problem followed by some questions from OOPS




In the first pass, create a copy of the original linked list. While creating this copy, use the same values for data and arbitrary_pointer in the new list. Also, keep updating the map with entries where the key is the address to the old node and the value is the address of the new node.
Once the copy has been created, do another pass on the copied linked list and update arbitrary pointers to the new address using the map created in the first pass.
Difference between Abstract class and Interface.
What is meant by Interface?
2 coding problems of Easy to Moderate level of difficulty



1. If string 'S' is already present in the dictionary, then you don’t need to break the string and you can print 0 in such cases.
2. If it is impossible to complete the given task, then print -1.
3. All the characters of string 'S' and words inside the Dictionary only contain Uppercased English Alphabets.
You can solve this problem by segmenting the large string at each possible position to see if the string can be completely segmented to words in the dictionary. To achieve memoization, you can store the second string in a new set each time. This will reduce both time and memory complexities.



The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

2 coding problems followed by a brief project discussion



For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].
Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].
Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].
Interval [10, 12] does not overlap with any interval.
Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
List of input intervals is given, and we’ll keep merged intervals in the output list.
For each interval in the input list:
If the input interval is overlapping with the last interval in the output list then we’ll merge these two intervals and update the last interval of output list with merged interval.
Otherwise, we’ll add an input interval to the output list.



Note: Since the number of ways can be very large, return the answer modulo 1000000007.
N=3

We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
So the total number of ways to reach “currStep” will be the sum of the total number of ways to reach at (currStep-1)th and the total number of ways to reach (currStep-2)th step.
Let dp[currStep] define the total number of ways to reach “currStep” from the 0th. So,
dp[ currStep ] = dp[ currStep-1 ] + dp[ currStep-2 ]
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?