Tip 1 : Good Knowledge of Time and Space Complexity
Tip 2 : Practice DSA Questions
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume.
This round consists of 50 MCQs on C++ programming language, we were given 50 minutes to solve 50 questions, this phase also had some output based ques where we were given a code snippet, and we were supposed to type the output of that program. Output-based questions didn’t have negative marking where the MCQ questions had negative marking, if you attempt around 30 questions you will be shortlisted for the next round.



Step 1) Initialize a variable to zero
Step 2) Start traversing the linked list
Step 3) Add the value of first node to this variable
Step 4) From the second node, multiply the variable by 10 and also take modulus of this value by 10^9+7 and then add the value of the node to this variable.
Step 5) Repeat step 4 until we reach the last node of the list.



Let an array ‘arr’ = [2,2,1,1].
In this example, the array can be split like this [2,2], [1,1] in this
case the first and last occurrence of 2 lies in a first subarray and
similarly first and the last occurrence of 1 lies in a second
subarray.
Step 1) Maintain a vector of pair V that stores the value of the current element and the index of the current element of the array arr[] for all elements in the given array.
Step 2) Sort the vector V.
Step 3) Initialize a variable, say cnt as 1 that stores the minimum number of subarrays required.
Step 4) Traverse the vector V for i in the range [1, N – 1] and perform the following steps:
Step 5) If the index of the ith element in the original array is (1 + index of (i – 1)th element) in the original array, then the two can be grouped together in the same subarray.
Step 6) Otherwise, the two elements need to be in separate subarrays and increment the value of cnt by 1.
Step 7) After completing the above steps, print the value of cnt as the resultant possible breaking of subarrays.



1
/ \
2 3
The root to leaf path 1->2 represents the number 12.
The root to leaf path 1->3 represents the number 13.
The total sum of all the possible root to leaf paths is 12+13 = 25
The output may be very large, return the answer after taking modulus with (10^9+7).
The idea is to do a preorder traversal of the tree. In the preorder traversal, keep track of the value calculated till the current node, let this value be val. For every node, we update the val as val*10 plus node’s data.

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?