Tip 1: I've completed the Striver Sheet of around 200 DSA Questions (Approximately 10 from each topic)
Tip 2: Read Alex xu book on Cracking System Design Interviews.
Tip 3: Extract keywords from the resume and prepare questions on top of it.
Tip 1: Look at the Job description of Job Posting and try to add more relevant content.
Tip 2: Use a good ATS Score template for your resume.
The assessment comprised four problem-solving questions in Data Structures and Algorithms, allowing the use of any preferred programming language. A total of 120 minutes were allotted for completion.



Given an integer array of stones and an integer rank, return the kth largest element in the array.
I used the priority queue for this :
- Create a priority queue to store integers. Priority queues ensure that the smallest element is always at the front.
- Iterate through each integer in the input array nums.
- Add each integer to the priority queue pq.
- If the size of the priority queue exceeds the value of k, remove the smallest element from the priority queue.
- After iterating through all elements, return the top element of the priority queue, which represents the kth largest element in the array.



Given an array of positive integer nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to the target. If there is no such subarray, return 0 instead.
- Initialize variables i, j, sum, and ans.
- Start a while loop with condition j less than the length of the array nums.
- Inside the loop, add the value at index j to the sum.
- Start an inner while loop with the condition sum greater than or equal to the target, and i less than the length of the array nums.
- Inside the inner loop, update ans to the minimum of (j - i + 1) and ans.
- Subtract the value at index i from sum and increment i.
- Increment j.
- After exiting the loops, return ans if it's greater than the length of the array nums, otherwise return 0.



Given an integer array of nums and an integer k, return the number of good subarrays of nums. A good array is an array where the number of different integers in that array is exactly k.
This was a tough sliding window question :
We have a pattern as most patterns in sliding windows which helped solve it.
During the interview, the Technical Manager led this round, expressing curiosity about my motivation for transitioning from my current role. Initially, he shared insights into the team culture. Following this discussion, the interview proceeded to a straightforward coding question.



Given an array of zeros and ones move all the zeros towards the end.
- Initialize the variable and to -1.
- Start a loop to iterate through each element of the array nums.
- Check if the current element is not equal to 0.
- If the element is not 0, increment ind and set the element at index ind to the current element.
- After the loop, increment ind to point to the first index after the last non-zero element.
- Start another loop from ind to the end of the array.
- Inside this loop, set each element to 0.
- After the loop, all non-zero elements will be at the beginning of the array, and all zeros will be at the end.
It was a dedicated technical problem-solving session, centered on graph algorithms. I was required to present my screen and explain each step of the code to the interviewer.



You're tasked with developing an algorithm to determine the sequence of class execution, akin to the behavior of a compiler. For instance, if class A extends class B, then class B must execute first. Given a list of classes organized in nested lists, your goal is to provide the order of execution. Return any possible order
Input : [[0,1], [1,2], [3,4]]
Output : [4,3,2,1,0] or [2,1,0,4,3]
1. Initialize a HashMap inDegree to store the indegree of each class. Initialize an empty ArrayList result to store the order of execution.
2. Iterate through the input list of class dependencies and populate the inDegree map.
3. Create a Queue queue and enqueue all classes with an indegree of 0.
4. While the queue is not empty, do the following:
- Dequeue a class currentClass from the queue.
Add currentClass to the result list.
Iterate through the input list of class dependencies:
-If currentClass is found as a prerequisite of another class dependentClass, decrement the indegree of dependentClass by 1.
- If the indegree of dependentClass becomes 0, enqueue dependentClass.
5. After the loop, if the size of the result list is equal to the total number of classes, return the result list as the order of execution. Otherwise, return an empty list, indicating that there's a cycle in the class dependencies.
The interview was purely technical, and the interviewer focused on the Bit manipulation Topic.



Given integers a, b, and c Determine an integer x such that : (a xor x) + (b xor x) = c.
I was able to provide the naive solution like iterating through values for x and checking if the expression is satisfying.
Later after so many hints I used bit manipulation.
1. Initialize an integer variable x to 0. This will hold the value of x that satisfies the equation.
2. Start a loop from 30 to 0 (inclusive) to iterate through each bit position.
3. Within the loop, extract the bits of a,b,c at current bit position i using right shift and bitwise and operations.
4. Check if the XOR of the corresponding bits of a and b is not equal to the corresponding bit of c. If the condition is true, it implies that changing the bit of x at position i affects the equation.
5. Inside the if statement, check two cases :
- if both a and b are 1 at bit position i return -1 which means no solution exists.
-if the corresponding bit of c is 1 at the current bit position i set the corresponding bit of x to 1 using bitwise OR operation with 1<6. After the loop completes, return the value of x which represents the integer x satisfying the equation.

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