I used the Codezen platform from Coding Ninjas to practice data structures-related questions. There, you will find topic-wise questions. So, try to practice there or on any other coding portal to enhance your speed and efficiency.
Include high-level projects on your resume, along with internships or previous experiences, providing a brief explanation of your role and accomplishments in each internship.
This was a coding round in which two questions were asked. I solved the first question fully and the second question partially.


A move may be from parent to child or from child to parent.
Given ‘ROOT’ = [2,-1,0,-1,-1]
The tree would look like this :

The answer would be 1, because the root node will transfer 1 coin to its right child. Thus both nodes have the same number of coins now.
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.
This was face to face interview round and the interviewer asked me one coding-only and project-related questions.



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 a Sliding window to solve this question. I initialized the start pointer and end pointer to 0, then moved the end pointer to a point at which the distinct elements between the start and end pointer were equal to k, I kept the track through a map and then moved the start pointer ahead till the point where distinct elements between the start and end pointer were equal to k - 1 and accordingly stored the minimum difference between end and start pointer over the whole array. Also after the algorithm explanation, I wrote to him fully commented on neat and clean code and dry run it on test cases given by the interviewer.
I explained the project thoroughly by describing its objective, features, tech stack, and flow diagram.
Tip 1: I explained the concept of function overriding in inheritance to him by providing a proper example. I also introduced the concept of virtual functions during this discussion.
Tip 2: I used diagrammatic explanations to illustrate the concept, detailing where variables reside in memory and how code is stored in different segments.

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