Tip 1: Prepare your resume well.
Tip 2: Deploy your projects so that the interviewer can view them. Also, provide a hyperlink on your resume.
Tip 3: Be thorough with data structures and algorithms. Also, prepare well for topics such as OS and DBMS.
Tip 1: Deploy your projects so that the interviewer can view them. Also, provide a hyperlink on your resume.
Tip 2: It's not necessary to have fancy projects. Only mention those you're confident about.
The interviewers focused on our knowledge of memory management in C++ and asked questions about dynamic memory allocation, memory leaks, and smart pointers. We were expected to discuss the differences between stack and heap memory and demonstrate an understanding of memory deallocation.



I solved this using permutations and combinations. The approach was to calculate the total ways to distribute N items among three people and then subtract invalid distribution from the total ways will result in the required answer.


{{X, X, O, X, X, X},
{X, X, O, X, O, X},
{X, X, X, O, O, X},
{X, O, X, X, X, X},
{O, X, O, O, X, X},
{X, X, X, X, O, X}}
In the above example, elements at positions (0, 2) and (1,2) do not form an island as there is no 'X' surronding it from the top.
I solved this question using the Flood-fill algorithm by replacing ‘O’ with a special character and applying Flood-fill for every edge of the matrix by traversing it.
In addition to DBMS questions, we encountered queries related to database administration and performance tuning. We were asked to discuss techniques for optimizing query execution plans, database indexing strategies, and backup and recovery procedures. We were evaluated on our ability to handle large datasets and ensure efficient and reliable database operations.



If more than one such contiguous subarrays exist, consider the subarray having the smallest leftmost index.
For example - if A is [1, 2, 2, 3, 1, 3 ] and k = 2 then the subarrays: [1,2], [2,3], [3,1], [1,3] are the smallest subarrays containing 2 distinct elements. In this case, we will consider the starting and ending index of subarray [1,2] i.e. 0 and 1.
I used the concept of the sliding window to solve this question. I initialized the start pointer and end pointer to 0, then moved the end pointer to a position where the number of distinct elements between the start and end pointers equaled k. I tracked this using a map. Next, I moved the start pointer forward until the number of distinct elements between the start and end pointers equalled k - 1. I stored the minimum difference between the end and start pointers over the entire array. After explaining the algorithm, I wrote neatly commented code and performed a dry run on test cases provided by the interviewer.


The given linked list is 1 -> 2 -> 3 -> 2-> 1-> NULL.
It is a palindrome linked list because the given linked list has the same order of elements when traversed forwards and backward.
Can you solve the problem in O(N) time complexity and O(1) space complexity iteratively?


The recursive formula is as follows:
int numberOfPaths(int m, int n)
{
if (m == 1 || n == 1)
return 1;
return numberOfPaths(m - 1, n) + numberOfPaths(m, n - 1);
}
However there are overlapping problems hence, we use DP to further optimize it.



A cell in a 2D matrix can be connected to 8 neighbours. Therefore, we can recursively call for 8 neighbours only. We keep track of the visited '1's so they are not revisited. I provided solutions using both BFS and DFS, and I had to code both methods. This question was followed by questions related to graphs.

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