Tip 1: Regularly participate in coding challenges on platforms like CodeStudio to enhance your problem-solving skills and gain exposure to diverse coding scenarios.
Tip 2: Engage in collaborative coding projects that focus on real-world applications. This demonstrates practical coding abilities and enhances your teamwork and project management skills, making you more appealing to potential employers.
Tip 1: Highlight quantifiable achievements and results on your resume, showcasing the impact of your contributions in previous roles, such as increased efficiency, cost savings, or successful project outcomes.
Tip 2: Tailor your resume for each job application by emphasizing relevant skills and experiences that align with the specific requirements of the position. This customization enhances your chances of standing out to recruiters and matching the role's needs.



'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.



‘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.

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 could 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.



You are given a directed and unweighted graph of 'V' vertices and 'E' edges. All edges are given in a 2-dimensional array of ‘Edges’ in which ‘Edges[i][0]’ and ‘Edges[i][1]’ contain an edge. Your task is to check if there exists a path from the vertex 'source' to 'destination'.
This was my last round. Those who are selected here goes to next round.



V is the number of vertices present in graph G and vertices are numbered from 0 to V-1.
E is the number of edges present in graph G.
The Graph may not be connected i.e there may exist multiple components in a graph.



Input: boxes = [1, 3, 2, 2, 2, 3, 4, 3, 1]
Output: 23
Explanation:
[1, 3, 2, 2, 2, 3, 4, 3, 1]
----> [1, 3, 3, 4, 3, 1] (Remove 3 boxes with number 2, 3*3=9 points)
----> [1, 3, 3, 3, 1] (Remove one box with number 4, 1*1=1 points)
----> [1, 1] (Remove 3 boxes with number 3, 3*3=9 points)
----> [] (2*2=4 points)

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL clause is used to specify the conditions in a query?