Tip 1 : First Go through all the concepts of Data Structures and algorithms, I have taken Coding ninjas course c++ interview preparation.
Tip 2 : Try to solve all the problems by yourself then it will be meant for you, if you can't solve them after 30-45 minutes of time then see the solution of it, and for this, I used to consult TA and mentors on coding ninjas course.
Tip 3 : Have confidence in yourself, if you can't solve it initially, gradually you will be able to solve the problems. Hard work pays off.
Tip 4 : Note down the main information's about your project like what you have done in the project and what difficulties you have faced, it will be a great way to tackle questions about the project in the interview.
Tip 1 : Keep it simple and mention what you actually know and achieved.
Tip 2 : Mention your institute email-id if you have, it adds weight to the resume
Tip 3 : Use the "Built/created/made X using Y to achieve Z" format when writing about projects or work done.
It was 24 hours window for the online round from 8 Oct 10:30 am to 9 Oct 10:30 am. There were 7 MCQ problems related to c++, java, DBMS, and operating systems. And 2 coding problems with one easy and one moderate level difficulty for question, we were supposed to write the whole program but for other question, the function was to be written only. I was able to solve the first problem fully and the second 50%, you are required to pass test cases.



For 'N' = 5 and 'K' = 2
Let the cost of different candies in the store be: [9 8 2 6 4]
For the minimum amount:
Ram can buy a candy with cost 2 and take candies with costs 9 and 8 for free.
Then, he can buy a candy with cost 4 and take candy with cost 7 for free.
Thus, the minimum cost will be 6 i.e. 2 + 4.
For the maximum amount:
Ram can buy a candy with cost 9 and take candies with costs 2 and 6 for free.
Then, he can buy candy at cost 8 and take candy at cost 4 for free.
Thus, the minimum cost will be 17 i.e. 9 + 8.
Thus, Minimum = 6 and Maximum = 17.
First Sort the price array. For finding the minimum amount start purchasing candies from starting and reduce k free candies from last with every single purchase. For finding the maximum amount start purchasing candies from the end and reduce k free candies from starting in every single purchase.



The same word from a dictionary can be used as many times as possible to make sentences.
The interviewer asked me questions about projects, general discussion, and 3 coding questions based on linked list, arrays, and binary tree.
I gave optimum approach for every question.



If given linked list is 1->2->3->4 then it should be modified to 1->2->4.
Step 1 : Take two pointers
Step 2 : Initialize both pointers to the head node and iterate one pointer by two and one by just one step
Step 3 : The pointer which is iterating by one step will reach the mid when other will reach the end.
Step 4 : Delete the mid pointer(which reached the mid).



1. It is an integer starting from 1.
2. The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
3. It should be as small as possible.
'ARR' = [4, 7, 2, 90]
Here, 2 is the smallest element, followed by 4, 7, and 90.
Hence rank of element 2 is 1, element 4 is 2, element 7 is 3, and element 90 is 4.
Hence we return [2, 3, 1, 4].
Step 1 : To compute the rank of the element first make a copy of given arr[] then sort that copied array in ascending order.
Step 2 : Then traverse in the copied array and put their rank in HashMap by taking a rank variable.
Step 3 : If the element is already present in HashMap then don’t update rank otherwise update rank of the element in HashMap and increment rank variable as well.
Step 4 : Traverse the given array arr[] assign the rank of each element using the rank stored in HashMap.



If the input tree is as depicted in the picture:
The Left View of the tree will be: 2 35 2
We can keep track of the level of a node by passing a parameter to all recursive calls. The idea is to keep track of the maximum level also. Whenever we see a node whose level is more than the maximum level so far. We print the node because this is the first node in its level (Note that we traverse the left subtree before the right subtree).

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