Tip 1 : Practice Daily. Consistency is the key
Tip 2 : Try to do at least 5 questions daily (LC, gfg, etc any platform u are comfortable with)
Tip 3 : Have some projects on resume related to the tech stack you want to work with.
Tip 1 : Have some projects on resume.
Tip 2 : Be prepared with in depth questions on whatever is written on resume
There were 2 coding questions. One was easy to medium difficult and other was of medium difficulty.






An integer 'a' is closer to 'X' than an integer 'b' if:
|a - X| < |b - X| or ( |a - X| == |b - X| and a < b )
if X = 4, 3 is closer to 'X' than 9, as |3-4| < |9-4| i.e., 1 < 5 and if X = 4, 2 and 6 are equally close to it, as |2-4| == |6-4| = 2, but we say 2 is closer to 4 than 6, as 2 is smaller.
1) There are 2 approaches.
2) First is to sort the array and let two pointers swipe up through the array, whenever the difference between the pointed at elements is smaller than target increase the upper one, whenever it is larger than target increase the lower one. While doing so, keep track of the best result found so far.
3) Another approach is by using TreeMap.



1) I used the 2 pointer approach to solve this.
2) Start a pointer at start and another at end. If the char at i or j is special char, move one step further, if not then swap the chars at i and j and repeat the same process.



Let’s say you have a binary tree as follows:-

You do not need to print anything; it has already been taken care of. Just implement the function.
Traverse the tree in any fashion and check if the node is the leaf node or not. If the node is the leaf node, add node data to sum variable.
Questions related to Java, OOPs, SQL etc.
What is JIT compiler?
Scheduling algos.
2nd highest salary using joins of tables
It was an HR round.Questions related to resume, Low level design, work experience, behavioural etc. This round stretched more than scheduled time so another round was scheduled which was again a DSA based technical round.
What are your hobbies?
Can you handle pressure?
This round had 3 problems. easy, medium and hard.



Input: 'a' = [2, 4, 6] and 'b' = [1, 3, 5]
Output: 3.5
Explanation: The array after merging 'a' and 'b' will be { 1, 2, 3, 4, 5, 6 }. Here two medians are 3 and 4. So the median will be the average of 3 and 4, which is 3.5.
1) I first used brute force by storing both the arrays in another array, sort the final array and return the middle element if odd or sum of middle two elements if even num of elements. O((m+n) log (m+n))
2) Another approach with linear time complexity is to merge the two sorted arrays and return the median.



‘S’ = racecar
The reverse of ‘S’ is: racecar
Since ‘S’ is equal to its reverse. So ‘S’ is a palindrome.
Hence output will be 1.
first reverse digits of num, then compare the reverse of num with num. If both are same, then return true, else false.



If the given string is “aaBBccc” then the frequency of characters: { a:2, B:2, c:3 }. Now, as ‘a’ and ‘B’ both have the same frequency 2, we need to delete one character either one ‘a’ or one ‘B’, to make their frequency different. After deleting any character we will get frequency as 1,2 and 3, as they all are different. Thus we got our solution as 1.

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