Tip 1: Juspay works on payments and transactions, where DBMS and transaction management are essential. Try to master these topics.
Tip 2: Make sure to cover the basics of OS.
Tip 3: Practice coding questions from easy to medium level.
Tip 1: Highlight your projects and mention the tech stack used.
Tip 2: Try to include DBMS and related technologies in your skillset.
I received a hackerrank link and was asked to complete it in the next 2 days.



Given a binary tree, find the lowest common ancestor (LCA) of two given nodes, p and q. The LCA of two nodes is defined as the lowest node in the tree that has both p and q as descendants. A node can be a descendant of itself.
1. Start from the root node.
2. Recursively check the left and right subtrees.
3. If the current node is either p or q, return that node.
4. If both left and right subtrees return non-null values, the current node is the LCA.
5. If only one subtree returns a non-null value, propagate that value upwards.
6. Return the node where both subtrees return a result or the valid subtree node.



Given an array of meeting time intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required.
Example 1:
Input: intervals = [[0,30],[5,10],[15,20]]
Output: 2
Example 2:
Input: intervals = [[7,10],[2,4]]
Output: 1
Constraints:
1 <= intervals.length <= 104
0 <= starti < endi <= 106
1. Sort the intervals based on their start times.
2. Use a min-heap (priority queue) to track the end times of the meetings.
3. Iterate over the sorted intervals:
1. If the current meeting starts after the earliest meeting ends, reuse the same room (remove the earliest end time from the heap).
2. Otherwise, allocate a new room (add the current meeting's end time to the heap).
4. The size of the heap at the end represents the minimum number of conference rooms required.
It was an online round scheduled on Google Meet. The interview was set for the afternoon between 2 and 3 PM. There was only one interviewer in this round.



Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
Since the result may be very large, so you need to return a string instead of an integer.
Example 1:
Input: nums = [10,2]
Output: "210"
Example 2:
Input: nums = [3,30,34,5,9]
Output: "9534330"
Constraints:
1 <= nums.length <= 100
0 <= nums[i] <= 109
1. Convert each integer in the array to a string for easier comparison.
2. Sort the string array based on a custom comparator. The comparator should compare concatenated results: for two strings a and b, check which is larger between a+b and b+a.
3. If the largest number after sorting is 0, return "0" as the result.
4. Concatenate the sorted strings to form the largest possible number and return it.
Write an SQL query to return the second highest salary of an employee from the table with the following schema: employeeID, employeeName, and salary.
Tip 1: Don't assume any schema column and confirm with the interviewer what the column names
Tip 2: Understand what the interviewer is asking, whether it's id of an employee having the second-highest salary or the salary value
Tip 3: Don't use limit and offset to get the second highest salary rather use nested query to get max and then find max salary less than max



You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses are broken into on the same night.
Given an integer array nums representing the amount of money in each house, return the maximum amount of money you can rob tonight without alerting the police.
Example 1:
Input: nums = [1,2,3,1]
Output: 4
Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
The total amount you can rob = 1 + 3 = 4.
Example 2:
Input: nums = [2,7,9,3,1]
Output: 12
Explanation: Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).
Total amount you can rob = 2 + 9 + 1 = 12.
1. Handle base cases for arrays of length 1 and 2.
2. Use dynamic programming to compute the maximum amount:
1. Initialize dp[0] and dp[1].
2. Iterate through the array, updating dp[i] with the maximum of not robbing or robbing the current house plus dp[i-2].
3. Return dp[N-1].
It was the final round and as mentioned by HR it was going to have questions based on Software design and Computer Fundamentals. In this round also there was only one interviewer.
The interviewer asked me to explain how our CPU handles multitasking. Follow-up questions were on multithreading and the difference between thread and process. I was also asked about context-switching.
Tip 1: The best way to prepare for the above questions is to understand how the CPU works and handles multiple tasks at the same time.
Tip 2: While answering these types of questions, the interviewer expects you to use real-life use cases and examples.
Tip 3: Don't overuse or misuse terms. For example, multitasking and multithreading are two different concepts; don't use them interchangeably.
What is indexing? When do we use it? Why do we use it and its advantages? Which Data Structure is used to implement this?
Tip 1: Cover Indexing in depth, then only you would be able to answer all the questions.
Tip 2: Try to learn the implementation of Indexing as well
Tip 3: While answering this question, mention both advantages and disadvantages(in case of overuse of indexing)
The interviewer asked me to explain the system architecture of the project on which I worked in my internship.
Tip 1: You should be fully prepared for questions coming out of your resume.
Tip 2: Use the STAR pattern to answer these questions.
Tip 3: Explain both Business Use case and technical aspects of your project
List down technologies you have worked on. Which technologies do you like the most?
Tip 1: Don't claim to have worked with technologies you haven't used.
Tip 2: Try to include frameworks and version control tools as well.
Tip 3: It will make a good impression on the interviewer if you can explain in which project or internship you used those technologies.



The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
Example 1:
Input: nums = [3,2,3]
Output: 3
Example 2:
Input: nums = [2,2,1,1,1,2,2]
Output: 2
Constraints:
n == nums.length
1 <= n <= 5 * 104
-109 <= nums[i] <= 109
Follow-up: Could you solve the problem in linear time and in O(1) space?
1. Initialize variables to track potential majority candidates and their counts.
2. Iterate through the array to find potential majority candidates and update their counts.
3. Reiterate through the array to count occurrences of each candidate and compare with the threshold.
4. Return the element that meets the majority criteria.

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