Tip 1 : Practice more and more competitive programming questions and take part in contests.
Tip 2 : Do at least 1 good project and you must be confident to elaborate it. You must know in detail about some basic questions about your project, for example: which data structure you have used? what is your contribution to that project if it is done in the group?.
Tip 3 : Solve puzzles from various platforms for example- geeksForGeeks puzzle section
Tip 1 : Add your Achievements. for example- any hackathon that you have won.
Tip 2 : Do not put false things on your resume.
Timing: 11:00 AM
Interviewer was good.



For N = 3 one valid array is [3,1,2,1,3,2].
The solution to the problem:
step 1 : make a pair vector of {val, freq} using the map
step 2 : sort pair vector based on greater freq at first.
step 3 : iterate over all pairs and keep track of the count (c) of the all previous pair to it and add (freq* c) to your answer.
By following the above steps you will get the minimum possible sum.
Timing: 12:01 PM
First, they asked me to describe my project.
Then, they asked about what is your contribution in this project.
then, what data structure you have used.
Then, they come to the coding problem.
The interviewer was good.



n = 4, list: 1 -> 0 -> 1 -> 0.
Now in this example, the value in the linked list is 1010, which is 10 in Decimal.
Hence the answer is 10.
step 1 : Initialize ans number to be equal to head value: ans = head.val.
step 2 : Iterate over the linked list starting from the head:
while head.next:
The current value is head.next.val.
Update the ans by shifting it by one to the left and adding the current value using logical OR:
ans = (ans<< 1) | head.next.val.
step 3 : Return ans.
Timing: 1:30 PM
First, they ask about me.
Then, they come to a puzzle and told me to give a solution with a time complexity of O(1).
The interviewer was good and helpful.
There are N red balls and M blue balls in a bag. Any 2 balls are removed at each step and are replaced with a new ball on the basis of the following conditions:
1. If they are of the same color, then they are replaced by a red ball.
2. If they are of different colors, then they are replaced with a blue ball.
Find the last ball to remain after the entire process in O(1).
Solution:
step1: if two 2 balls removed are the same color
RR:
remaining ball in bag : N-2 + 1 , M => N-1 , M ------ eq (1)
BB:
remaining ball in bag: N +1, M-2 => N+1 , M-2 ------- eq (2)
step2: if two balls removed are different colors:
RB or BR:
remaining ball in bag: N-1, M-1+1 => N-1 , M ----- eq(3)
from the above 3 eq in which eq(1) and eq(2) are the same, we can conclude:
if M is even then, our result will be a red ball.
if M is odd then, our result will be a blue ball.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?