Tip 1: Practice at least 500 DSA problems.
Tip 2: Practice SQL queries and DBMS.
Tip 3: Prepare any backend technology.
Tip 1: Mention some good project and your detailed work experience if any.
Tip 2: Mention your achievements with supporting statistics to showcase your impact effectively.
The first round lasted 50 minutes, and the interviewer was quite relaxed. We started with introductions, followed by a discussion about my journey and experience. He then provided a Google Doc with the first problem and asked me to implement the solution in my local editor, which I completed in 20 minutes. The second problem required me to explain the approach first and then write the pseudocode.



Given a binary array nums[ ] and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.
I had previously solved a similar problem, so I had an idea of how to approach the solution. First, I asked the interviewer for test cases and then explained my thought process, outlining how the problem could be solved using the Sliding Window technique.
Approach:
Step1 : Declare two pointers i and j representing the window [i.....j].
Step2 : Use a variable count to store the number of 0s in the current window.
Step3 : If the window is valid (count <= k), expand it and update the answer; otherwise, shrink it from the left.
Time Complexity: O(N), Space Complexity: O(1).



Given a weighted, undirected tree, the task is to find the maximum path distance between any two nodes.
Explanation: It took me some time to dry-run the problem, and then I explained that this can be solved using a simple DFS function.
Steps:
Perform a DFS traversal to find the maximum path value if the current node is the root.
Identify the two child nodes with the highest path sums and combine them.
The time complexity is O(N), and the space complexity is O(N).
Design a hybrid caching system that efficiently supports both Least Recently Used (LRU) and Least Frequently Used (LFU) eviction policies. Your task is to implement a cache that dynamically adjusts between LRU and LFU based on the access patterns of stored keys.
The cache should support the following operations efficiently:
get(key) -> value: Retrieves the value associated with the key if it exists in the cache; otherwise, returns -1.
put(key, value): Inserts a key-value pair into the cache. If the cache reaches its capacity, it must evict an item based on a combination of LRU and LFU policies.
The cache should intelligently switch between LRU and LFU behaviour based on access patterns
Least Recently Used (LRU)
LRU discards the least recently used item when the cache reaches its capacity.
It is effective in scenarios where recently accessed elements are more likely to be used again.
Implemented using a doubly linked list and a hash map, where the most recently accessed item is moved to the front, and the least recently accessed is at the back.
Least Frequently Used (LFU)
LFU discards the least frequently used item when the cache is full.
It is useful when some elements are accessed far more often than others.
Implemented using a frequency map, where each frequency bucket contains keys used that many times.
Hybrid Approach (LRU + LFU)
The cache should be adaptive, meaning:
If multiple items have the same frequency, use LRU to decide eviction.
If an item is accessed more frequently, it should remain in the cache even if it was accessed a long time ago.
The cache should maintain both recency and frequency to make efficient eviction decisions.
It was Managerial Round. The engineering manager conducted this round, starting with a discussion about my introduction and work experience. After that, we moved on to technical questions, beginning with C++ pointers—their definition and their relationship with arrays in C++. Then, he asked basic questions on Node.js and Express.js. Finally, he presented me with a puzzle, which I solved with some hints.
You are given 9 balls, where 8 balls weigh 100 grams each, and 1 ball weighs 95 grams (lighter). You need to identify the odd (lighter) ball using the minimum number of operations. You have access to a weighing machine with two sides, and in each operation, you can compare the weight of two sets of balls.
You can find the odd ball in just 2 operations using the following approach:
1. Divide the 9 balls into 3 groups, each containing 3 balls.
2. Perform the first weighing:
-> Compare two groups on the weighing machine.
-> If both groups are equal in weight, the odd ball is in the third group.
-> If the weights differ, the lighter group contains the odd ball.
3. Perform the second weighing:
-> From the identified group of 3 balls, pick any two balls and compare their weights.
-> If they are equal, the third ball is the odd one.
-> If they are unequal, the lighter ball is the answer.

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