Tip 1: Practice coding questions regularly instead of cramming at the last moment.
Tip 2: Work on a few good projects to showcase practical knowledge.
Tip 3: Revise core concepts multiple times, especially before interviews.
Tip 1: Make sure your resume has a good balance of strong skills and impactful projects.
Tip 2: Highlight key achievements and technical contributions clearly so they stand out.
The test was conducted in the evening, and the environment was smooth, without any technical issues. The instructions were clearly provided, and the round was strictly proctored. It included a mix of MCQs to test fundamentals and coding problems to assess problem-solving skills.


Input: ‘N’ = 5, ‘K’ = 4, ‘NUMS’ = [ 1, 2, 1, 0, 1 ]
Output: 4
There are two subarrays with sum = 4, [1, 2, 1] and [2, 1, 0, 1]. Hence the length of the longest subarray with sum = 4 is 4.
Step 1: First, I considered the brute-force method, where we check every possible subarray and calculate its sum. This works but takes O(N²) time.
Step 2: Since the problem was on a coding platform with large constraints, the brute-force approach was not efficient.
Step 3: I optimized it by using the prefix sum + hashmap technique. While iterating through the array, I maintained the cumulative sum and checked if (currentSum - K) existed in the hashmap. If yes, it meant a subarray with sum K was found, and I updated the maximum length.
Step 4: This gave me an efficient O(N) time and O(N) space solution, which passed all test cases on the platform.
Which of the following best defines polymorphism in Object-Oriented Programming?
Polymorphism specifically refers to the ability of a method or object to take multiple forms, enabling dynamic method binding or adopting multiple behaviors with a unified interface.
What is the worst-case time complexity of searching an element in a balanced Binary Search Tree (BST) with n nodes?
For a balanced BST like AVL or Red-Black Tree, the height is O(log n), so search times also follow O(log n) in the worst case.
Which of the following ensures that no two transactions interfere with each other in a database system?
Concurrency control ensures that transactions execute in a serializable manner, avoiding issues like lost updates or dirty reads, thus preventing interference.
The interview was scheduled in the afternoon and started on time. The environment was smooth, and the interviewer was friendly, providing hints when needed. The round mainly focused on problem-solving using data structures and also assessed my thought process and clarity in explaining solutions.


1. Push(num): Push the given number in the stack.
2. Pop: Remove and return the top element from the stack if present, else return -1.
3. Top: return the top element of the stack if present, else return -1.
4. getMin: Returns minimum element of the stack if present, else return -1.
For the following input:
1
5
1 1
1 2
4
2
3
For the first two operations, we will just insert 1 and then 2 into the stack which was empty earlier. So now the stack is => [2,1]
In the third operation, we need to return the minimum element of the stack, i.e., 1. So now the stack is => [2,1]
For the fourth operation, we need to pop the topmost element of the stack, i.e., 2. Now the stack is => [1]
In the fifth operation, we return the top element of the stack, i.e. 1 as it has one element. Now the stack is => [1]
So, the final output will be:
1 2 1
Step 1: My first thought was to find the minimum by traversing the stack each time getMin() is called, but that would take O(N) time.
Step 2: I then thought of keeping an extra variable to track the minimum, but the problem arose when the minimum element was popped.
Step 3: To optimize, I maintained an auxiliary stack alongside the main stack. For every push, I stored the new minimum in the auxiliary stack. For every pop, I removed the top from both stacks. This way, getMin() always returns the top of the auxiliary stack in O(1) time.
Step 4: Implemented this logic, tested with sample inputs, and it worked as expected.
Implement a simple program using Object-Oriented Programming (OOP) concepts, including inheritance, polymorphism, and encapsulation.
Step 1: First, I created a base class (e.g., Shape) with common attributes, including an area() function.
Step 2: Then, I implemented inheritance by creating derived classes such as Circle and Rectangle that overrode the area() method, demonstrating polymorphism.
Step 3: I applied encapsulation by keeping class data members private and accessing them through getters and setters.
Step 4: Finally, I created objects of these derived classes and demonstrated runtime polymorphism using a base class pointer.



1. All the elements are in the range 0 to N - 1.
2. The elements may not be in sorted order.
3. You can return the duplicate elements in any order.
4. If there are no duplicates present then return an empty array.
Step 1: Initially, I considered using nested loops to check every pair of elements, but that would take O(N²) time.
Step 2: Then, I optimized the approach by using a hash set or unordered_map to keep track of visited elements. If an element appeared again, I marked it as a duplicate. This reduced the complexity to O(N) with extra space.
Step 3: For a further optimized solution (if asked), I considered marking elements in the array itself (by negating the value at the corresponding index), which can find duplicates in O(N) time and O(1) space.
The HR interview was conducted in the afternoon, and the environment was friendly. The interviewer was polite, made me feel comfortable, and focused primarily on my personality, communication skills, and overall fit for the company. No technical questions were asked in this round; however, scenario-based and behavioral questions were discussed.
How do you think life will change with AI in the coming years?
Tip 1: Mention how AI is already shaping everyday life (healthcare, automation, recommendations, virtual assistants).
Tip 2: Highlight both opportunities (efficiency, better decision-making, new jobs) and challenges (job displacement, ethics, data privacy).
Tip 3: Conclude with a balanced view: AI will act as a support system for humans, and adapting to it will be the key to success.
If someone is facing a coding error while transferring their project to another laptop, how would you resolve it?
Tip 1: I explained that such issues often arise due to dependency or environment mismatches between systems.
Tip 2: I suggested using Docker to containerize the application so it runs the same way on any machine, regardless of OS or environment.
Tip 3: I also mentioned documenting dependencies (via requirements.txt or package.json) as a backup but emphasized Docker as the most reliable solution for portability.
Where do you see yourself after 5 years?
Tip 1: Keep the answer professional and aligned with the company’s growth (avoid mentioning frequent job switching).
Tip 2: Show eagerness to learn and grow, both technically and in terms of responsibilities.
Tip 3: Emphasize that you see yourself contributing to impactful projects, possibly mentoring juniors, and being an integral part of the organization.

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