Tip 1: Prepare System Design
Tip 2: Practice DSA Questions properly
Tip 3: Practice OOPS and DBMS Concepts
ip 1: Include at least 4 projects on your resume.
Tip 2: Do not write false information. You will always get caught. Be genuine.
First, there was a brief introduction. Then, moving on to DSA, using HackerRank CodePair as the live coding platform, he asked me to code the solution for ‘Convert a Binary Tree into its Mirror Tree’. I had to write the entire code, including the main function, and then solve one linked list question.




1. Make in-place changes, that is, modify the nodes given a binary tree to get the required mirror tree.
Follow the steps below to solve the problem:
Call Mirror for left-subtree i.e., Mirror(left-subtree)
Call Mirror for right-subtree i.e., Mirror(right-subtree)
Swap left and right subtrees.
temp = left-subtree
left-subtree = right-subtree
right-subtree = temp



Input: 'list' = [1, 2, 3, 4], 'k' = 2
Output: 2 1 4 3
Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.
All the node values will be distinct.
We have used a stack that will store the nodes of the given linked list. Firstly, push the k elements of the linked list in the stack. Now pop elements one by one and keep track of the previously popped node. Point the next pointer of the previous node to the top element of the stack. Repeat this process, until NULL is reached.
This algorithm uses O(k) extra space.
After an introduction, we discussed my projects for about 10-15 minutes. I was asked to explain in detail one of my projects. Then, he asked me to write the code for finding the first occurrence of a substring in another circular string. After that, I had to write the code for the number of counts of target values in a sorted array. I first discussed the brute-force approaches with him and then moved to optimized approaches.
He was satisfied with it, and the round ended with me asking him the questions I had.



1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
1) Use Binary search to get an index of the first occurrence of x in arr[]. Let the index of the first occurrence be i.
2) Use Binary search to get the index of the last occurrence of x in arr[]. Let the index of the last occurrence be j.
3) Return (j – i + 1);



Two strings are said to be anagram if they contain the same characters, irrespective of the order of the characters.
If 'STR1' = “listen” and 'STR2' = “silent” then the output will be 1.
Both the strings contain the same set of characters.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?