Tip 1 :Practice DSA and give regular contests on leetcode, codestudio etc.
Tip 2 : Make atleast 3 good projects.
Tip 3 :Practice mock interviews.
Tip 1: At least add three good projects to your resume, and make sure you know everything about them.
Tip 2: Keep it clean and simple.
On 28th September, I took my online assessment, which consisted of two DSA questions — one on graphs and the other based on binary search. I was able to solve one question and partially solve the other. Later, on 28th September at 10:17 PM, I received an email stating that my interviews were scheduled for the next day.



To solve it, I aimed to find the target value that minimizes the effort to make all locks the same. First, I defined a helper that calculates the cost to adjust each lock to a specific target, considering both direct adjustments and the option to "wrap around" to minimize changes. Using binary search, I then explored potential target values, starting with edge cases and iteratively refining the target to find the one that yields the lowest overall cost. This efficient approach narrows down possibilities quickly, leading to the minimum operations needed to align all locks.



1) Here length of the path refers to the number of edges in that path.
2) You can start and stop at any node.
3) You can visit any node 0 or more times.
4) You can use any given edge 0 or more times.
To solve this problem, I used depth-first search (DFS) to calculate the minimum and maximum sum of distances when values in a tree are shuffled. For the minimum sum, I aimed to minimize the distances by assigning values to the closest possible nodes without repeating any initial values. This involves identifying and traversing only necessary paths to reduce redundant moves, particularly focusing on nodes that aren't leaves. For the maximum sum, I maximized the distances by assigning values as far apart as possible within the tree's structure. By carefully counting and adding the distances for both configurations, I obtained the required minimum and maximum sums of distances in an efficient way.
I was asked about my projects, OOPS and one question on Problem-solving (i.e. DSA) was asked. I was told to code some parts of my project and to explain how I used OOPS in that project by creating different classes. I was also asked to define inheritance and polymorphism.



You need to perform swapping of nodes in the given linked list. Do not swap the values.
If the given list is:[1 -> 4 -> 5 -> 6 -> 9 -> NULL] and ‘K’ is 2, then after swapping 2nd node from the start i.e, 4 with 2nd node from the end i.e, 6 we get the final list as: [1 -> 6 -> 5 -> 4 -> 9 -> NULL].
To solve this problem, the approach involves identifying the nodes that need to be swapped by their positions from the beginning and the end of the linked list. First, traverse the list to determine its length, which helps locate the `k`th node from the beginning and the `k`th node from the end. Specifically, the `k`th node from the end can be found at position `(length - k + 1)`. After determining these positions, traverse the list again to reach these nodes. Once both nodes are identified, simply swap their values rather than their positions, which avoids restructuring the list. Finally, return the head of the linked list, as the list structure remains the same, with only the values swapped. This method ensures efficiency by only requiring two traversals, making it an optimal solution.
In this round, I was asked about my projects, DBMS, and OOPS concepts. I was also asked to write two SQL queries and solve two DSA problems. Additionally, he asked me about multiple inheritance, function overloading, and function overriding.



Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
3 is written as III in Roman numeral, just three ones added together. 13 is written as XIII, which is simply X + III. The number 25 is written as XXV, which is XX + V
To solve this problem, I first mapped each Roman numeral character to its respective integer value for easy reference. Then, I iterated through the characters of the Roman numeral string to apply the conversion rules. For each character, I checked if its value was smaller than the value of the next character, indicating a subtractive combination (like "IV" representing 4). In such cases, I subtracted its value from the running total; otherwise, I added its value to the total. By the end of the traversal, the accumulated result represented the integer value of the Roman numeral. This approach allowed for efficient handling of both additive and subtractive cases in a single pass.
I expected behavioral and situational questions in this round, but it was completely different from what I had anticipated. She started with my introduction and then asked me about the core subjects I know and why I chose the ECE-AI branch. She also asked if I was comfortable switching to new tech stacks and why I would like to join ServiceNow.
Then, she asked how I would design BookMyShow if given the opportunity. She encouraged me to use my creativity and did not ask about any system design concepts. She inquired about how many classes I would use and asked me to define those classes with the necessary properties. We had a detailed discussion on how I would handle payments, reviews, and ratings, and how many tables I would use for those. We also discussed what would happen if I combined the reviews and ratings tables.
Additionally, she asked how many types of APIs I am familiar with and inquired about Firebase Cloud Messaging. At the end, she provided feedback on areas where I could improve.

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