Tip 1: Practice coding questions related to arrays and strings.
Tip 2: Explain the logic or execution before writing the code.
Tip 3: Ask the interviewer for tips and whether optimization is required.
Tip 1: It is advisable to keep your resume concise and limit it to one page. Clearly mention your skills to ensure they are easily identifiable and comprehensible to the reader.
Tip 2: When describing your experience, highlight specific projects where you utilized your skills and emphasize the improvements you brought on board. Explain how you applied your skills to enhance the project, whether it involved optimizing processes, implementing new features, or resolving issues. This demonstrates your ability to contribute effectively and showcases your skill set in action.
The interview was 1 hour long, and the panel was from the U.S. The main crux of this round was to check my command over the main skills.
Given two sorted arrays, arr1[] and arr2[], in non-decreasing order, merge them in sorted order without using any extra space. Modify arr1 so that it contains the first n elements and modify arr2 so that it contains the last m elements. Input: n = 4, m = 5, arr1[] = [1, 3, 5, 7], arr2[] = [0, 2, 6, 8, 9]. Output: arr1[] = [0, 1, 2, 3], arr2[] = [5, 6, 7, 8, 9].
To merge two sorted arrays, `arr1[]` and `arr2[]`, in non-decreasing order without using any extra space, you can follow the steps below:
1. Initialize three variables: `i` as the index for `arr1[]`, `j` as the index for `arr2[]`, and `k` as the index for the merged array (starting from the last index of `arr1[]`).
2. Compare the elements at `arr1[i]` and `arr2[j]`. If `arr1[i]` is greater than `arr2[j]`, swap the elements so that `arr1[i]` contains the smaller value.
3. Move the indices `i` and `k` one step back (`i--` and `k--`) to compare the previous elements of `arr1[]` and `arr2[]`.
4. Repeat steps 2 and 3 until `i` becomes less than 0 or `j` becomes less than 0.
5. After completing the above steps, `arr1[]` will contain the merged sorted array. To modify `arr2[]`, simply copy the remaining elements from `arr2[]` to `arr2[m-1]` in reverse order.



How can you check if a given linked list is a palindrome?
Input: head: 1 -> 2 -> 1 -> 1 -> 2 -> 1
Output: true
Explanation: The given linked list is 1 -> 2 -> 1 -> 1 -> 2 -> 1, which is a palindrome. Hence, the output is true.
1. Use two pointers, say **fast** and **slow**, to find the middle of the list. **Fast** will move two steps ahead, and **slow** will move one step ahead at a time.
1.1 If the list is odd, when **fast->next** is **NULL**, **slow** will point to the middle node.
1.2 If the list is even, when **fast->next->next** is **NULL**, **slow** will point to the middle node.
2. Reverse the second half of the list starting from the middle.
3. Check if the first half and the reversed second half are identical by comparing the node values.
4. Restore the original list by reversing the second half again and attaching it back to the first half.
This round is all based on coding question of Data Structure and algorithm.
A recursive solution is to try all the possible ways of filling the two knapsacks and choose the one that gives the maximum weight. To optimize this idea, we need to determine the states of dynamic programming (DP) upon which we will build our solution. After some observation, we can conclude that this can be represented in three states: (i, w1_r, w2_r). Here, ‘i’ represents the index of the element we are trying to store, w1_r represents the remaining space in the first knapsack, and w2_r represents the remaining space in the second knapsack. Thus, the problem can be solved using a 3-dimensional dynamic programming approach with a recurrence relation.



Given two sorted linked lists consisting of N and M nodes respectively. The task is to merge both of the lists (in place) and return the head of the merged list.
Input: a: 5->10->15, b: 2->3->20
Output: 2->3->5->10->15->20
Input: a: 1->1, b: 2->4
Output: 1->1->2->4
There are two ways to solve this:
Brute Force Way:
In this approach, we use an array of size (n + m), where n and m are the lengths of the respective linked lists. We then store all the elements in a vector, sort the vector, and create a new linked list; this will be our answer.
Using Recursive Merge:
The idea is to proceed with the node in the recursion whose value is lesser. When either of the nodes reaches the end, we append the rest of the linked list.
Follow the steps below to solve the problem:
This round is a mix of managerial and HR questions, which mainly focus on the types of projects I have worked on, my tech stack, and some situation-based questions.
Where do you see yourself after 5 years?
I kept my answer in my tech profile format. I aspire to become a technical architect, so I have portrayed that I want to solve bigger problems from which the masses can benefit.
Tip 1: This is a very personal question, so whatever your plans are, be straightforward.
Tip 1: Share something that has created an impact on your project/app's performance or any other metric.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: