Tip 1: Practice Data Structures and Algorithms regularly, focusing on problem patterns and edge cases rather than memorization.
Tip 2: Build and improve real-world projects to strengthen core concepts, code quality, and practical system understanding.
Tip 1: Highlight relevant projects and internships, emphasizing measurable impact and the technologies used.
Tip 2: Keep the resume concise, truthful, and tailored to the job role you are applying for.



As this value might be large, print it modulo 10^9 + 7
Step 1: I first tried a brute-force approach by generating all possible subsequences and checking their sums. This worked for small inputs but was inefficient for larger arrays.
Step 2: The interviewer suggested optimizing the solution. I then identified it as a classic Dynamic Programming problem.
Step 3: I implemented a DP solution using a 2D array dp[n+1][sum+1], where dp[i][j] represents the number of subsequences from the first i elements with sum j. I filled the table iteratively, considering whether to include or exclude each element.
Step 4: The final solution efficiently calculated the answer in O(n * sum) time and passed all test cases. The interviewer appreciated the optimized approach and the clarity of my explanation.



In the below graph, there exists a cycle between vertex 1, 2 and 3.

1. There are no parallel edges between two vertices.
2. There are no self-loops(an edge connecting the vertex to itself) in the graph.
3. The graph can be disconnected.
Input: N = 3 , Edges = [[1, 2], [2, 3], [1, 3]].
Output: Yes
Explanation : There are a total of 3 vertices in the graph. There is an edge between vertex 1 and 2, vertex 2 and 3 and vertex 1 and 3. So, there exists a cycle in the graph.
Step 1: I first tried a naive approach by checking all possible paths for cycles, but it was inefficient for larger graphs.
Step 2: The interviewer suggested using a standard graph traversal method for optimization. I then decided to use Depth-First Search (DFS) to detect cycles efficiently.
Step 3: I implemented DFS, keeping track of visited nodes and parent nodes. If a visited node was encountered that was not the parent, it indicated a cycle.
Step 4: The solution correctly detected cycles in O(N + M) time and worked for all test cases. The interviewer appreciated the clarity of my approach and the optimized solution.
The HR round mainly focused on understanding my background, communication skills, and career goals. Questions included my educational journey, internship and project experiences, strengths and weaknesses, reasons for applying to the company, and how I handle challenges and teamwork situations. The interviewer also assessed my cultural fit and motivation for the role.

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