Tip 1 : I was informed about the interview only 3 days prior to it. So, if you find yourself in a position like me, one thing I would mention is to NEVER LEARN ANY NEW TOPICS if you have less than 2 days. Brush up on the topics you already know.
Tip 2 : Practise Time and space Complexities well. Know your basics and practice as many questions as possible on LeetCode.
Tip 3 : Refer to previously asked questions in the interview of the company. Read about the interview process for the role you're applying for. Learn about the role and the company as well.
Tip 4: If you're new to giving interviews, practice mock interviews with your friends or family.
Tip 1 : Keep it to one side
Tip 2 : Only add the things necessary for the role that you're applying for.
Tip 3 : Don't lie in the resume and add projects related to the role.
Tip 4 : Add any volunteering work that you did.
2 hard questions had to be completed in 70 Minutes. we had a time window from 12 pm to 6 pm.



‘B’ = 4, ‘S’ = “4321”, ‘K’ = 3.
The given number is not stable as ‘S[3]’ is not the same as ‘S[0]’ but 3%3 = 0 same as 0%3. ‘S[3] = 1’ and ‘S[0] = 4’. But the number “4324” is stable. As, for all ‘i’, ‘S[i]’ = ‘S[i%K]’ and “4324” is also greater than the given number. It can be proved that this is the best possible answer.
Hence, the answer is “4324”.



'str' = abcad and 'k' = 2.
We can see that the substrings {ab, bc, ca, ad} are the only substrings with 2 distinct characters.
Therefore, the answer will be 4.
I first used brute force and I got TLE. So, I optimized the code using sliding windows and map and it passed all test cases.
It was an online interview held on google meet. The interviewer shared a question in the beginning of the interview and for the next 45 minutes, we had to brainstorm approaches to solve the quesntion.



‘GRID[i][j]’ = 0, if there is no building at cell (i, j).
Consider the following 2*2 ‘GRID[][]’:
[1, 2]
[3, 4]
Its projection in XY, YZ, XZ plane is shown below -:

Area covered in XY plane is 4, Area covered in YZ plane is 6, Area covered in ZX plane is 7, Thus the total area is 4 + 6 + 7 = 17.
I solved using a nested loop that had O(n^2) time complexity. After the interview, I was able to come up with a greedy approach with O(n) time complexity.
It was an online interview held on google meet. The interviewer shared a question in the beginning of the interview and for the next 45 minutes, we had to brainstorm approaches to solve the quesntion.

1) He must select exactly one wrapper to wrap all the chosen gifts.
2) He can select one or more gifts or no gifts at all.
3) He has 2 copies of the same gift. So, he can take 0 or 1 or 2 copies of each gift.
Let’s say you have two wrappers with cost [1, 2] and three gifts with cost [3, 4, 5] and ‘X’ = 7. In the first case, you select wrapper number ‘2’ and gift number ‘1’ and ‘3’, so your total cost will be 2 + 3 + 5 = 10. While in the second case, you select wrapper number ‘1’ and gift number ‘2’, so your total cost will be 1 + 4 = 5. So out of both the cases, second case is closer to ‘X’ as abs(7 - 5) = 2 and abs(7 - 10) = 3.
I was it to figure out that this problem can be solved using a priority queue but I wasn't sure how. After trying different methods the interviewer give me a tip on how to use the priority queue method for this and I was able to grasp the logic for solving the problem.

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?