Tip 1 : Always try to think from the basic solutions, but in timed interviews, give out the most optimized approach
Tip 2 : Practice atleast 20-25 questions from each Data structure
Tip 3 : Be clear & through about your work Experience
Tip 1 : Keep it 1 pager
Tip 2 : Try to highlight the main words in bold & keep the details short & crisp
This was a technical round to check my technical acumen.
My past projects were discussed along with my work experience at my previous company.
3 Coding questions, 1 puzzle & tech-logic question.



Assuming, the linked list is 10 -> 20 -> 30 -> 40 -> 50 -> 60 -> NULL. X = 2 and Y = 5. On reversing the given linked list from position 2 to 5, we get 10 -> 50 -> 40 -> 30 -> 20 -> 60 -> NULL.
My solution used the idea to reverse a normal linked list.
1. Get the pointer to the head and tail of the reversed linked list.
2. Get the pointer to the node before mth and node after nth node.
3. Reverse the list
4. Connect back the links properly.



1. A complete binary tree is a binary tree in which nodes at all levels except the last level have two children and nodes at the last level have 0 children.
2. Node ‘U’ is said to be the next node of ‘V’ if and only if ‘U’ is just next to ‘V’ in tree representation.
3. Particularly root node and rightmost nodes have ‘next’ node equal to ‘Null’
4. Each node of the binary tree has three-pointers, ‘left’, ‘right’, and ‘next’. Here ‘left’ and ‘right’ are the children of node and ‘next’ is one extra pointer that we need to update.


I used nested loops.
The outer loop, goes through all the levels and the inner loop goes through all the nodes at every level.



Input: 'str' = "abca"
Output: 1
Explanation:
If we insert the character ‘b’ after ‘c’, we get the string "abcba", which is a palindromic string. Please note that there are also other ways possible.
Find out the LCS of string and its reverse.
This will give you how many maximum characters can form a palindrome & then insert the remaining characters using the following steps.
1. Find the length of LCS of the input string and its reverse. Let the length be ‘l’.
2. The minimum number of insertions needed is the length of the input string minus ‘l’.
There are 4 persons (A, B, C and D) who want to cross a bridge in night.
A takes 1 minute to cross the bridge.
B takes 2 minutes to cross the bridge.
C takes 5 minutes to cross the bridge.
D takes 8 minutes to cross the bridge.
There is only one torch with them and the bridge cannot be crossed without the torch. There cannot be more than two persons on the bridge at any time, and when two people cross the bridge together, they must move at the slower person's pace. Can they all cross the bridge in 15 minutes?
Step 1 : A and B cross the bridge. A comes back. Time taken 3 minutes. Now B is on the other side.
Step 2 : C and D cross the bridge. B comes back. Time taken 8 + 2 = 10 minutes. Now C and D are on the other side.
Step 3 : A and B cross the bridge. Time taken is 2 minutes. All are on the other side.
Total time spent: 3 + 10 + 2 = 15 minutes.
1 hour coding round via Video-call, majorly did coding questions & discussed work at previous company.
Brief discussions about: DBMS, indexing ways, B Trees, API writing, webD Backend experience



For example, if the input array is: [0, 1, -2, 3, 4, 0, 5, -27, 9, 0], then the output array must be: [1, -2, 3, 4, 5, -27, 9, 0, 0, 0].
Use 0 as a pivot element and whenever you see a non zero element, swap it with the pivot element.
So all the non zero element will come at the beginning.



Detailed background discussion
Work at present company, tech stack, contributions to projects, reason to switch
Databases questions like indexing, joins, etc
What all data structures used in ur daily work at samsung
Cpp and java basics, webd knowledge



Input: Consider the following Binary Tree:
Output:
Following is the level-order traversal of the given Binary Tree: [1, 2, 3, 5, 6, 4]
9 weights of equal shape and size, 1 has different weight, given a weighing scale, find the min number of ways to find out which weight is the different one
Divide the 9 balls into 3 groups of 3. Compare the weight of two of those groups.
The heavier group should then be obvious, it will either tip the scales, or, if the scales stay balanced, then it is the group you didn't include.
Now, choose 2 balls from this group and compare their weights, and using the same logic as before, the heavier ball will be obvious.

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