Tip 1 : Prepare Data Structures and Algorithms very well , Practice basic questions on implementation of various DS along with some minor variations. You should be aware of the basic algorithms as well and should be able to write clean production grade code.
Tip 2 : Prepare some good projects , based on your skillset...be it Web Dev , Android , Machine Learning , Blockchain , etc.
Tip 3 : Try giving mock interviews before your actual interviews , this will help you when you try to speak out/explain your approach in the interview.
Tip 1 : Try to have 1 page resume highlighting your skillset as comprehensive as possible.
Tip 2 : Try to add keywords mentioned in the Job Description in your resume(if you are good in those tech stack)
It was having medium kind of difficulty , involved two question , first one was simple array problem , and the second one was quite hard DP problem.



Input: 'n' = 7, 'x' = 3
'arr' = [1, 1, 1, 2, 2, 3, 3]
Output: 2
Explanation: Total occurrences of '3' in the array 'arr' is 2.
Step 1 : the array was sorted
Step 2 : so I applied Binary Search to find the leftmost index of the target item in the array
Step 3 : and then rightmost index of the target item in the array
Step 4 : and then returned (right-left +1) as answer.



If ‘ARR’ is {1,2,3,4} and ‘K’ = 4, then there exists 2 subsets with sum = 4. These are {1,3} and {4}. Hence, return true.
we will create a 2D array of size (arr.size() + 1) * (target + 1) of type boolean. The state DP[i][j] will be true if there exists a subset of elements from A[0….i] with sum value = ‘j’. The approach for the problem is:
if (A[i-1] > j)
DP[i][j] = DP[i-1][j]
else
DP[i][j] = DP[i-1][j] OR DP[i-1][j-A[i-1]]
This means that if current element has value greater than ‘current sum value’ we will copy the answer for previous cases
And if the current sum value is greater than the ‘ith’ element we will see if any of previous states have already experienced the sum=’j’ OR any previous states experienced a value ‘j – A[i]’ which will solve our purpose.
It was a medium round.



Step 1 : I first told him the brute force approach of using the hashmap and then told it's T.C.
Step 2 : Then I told him the slow and fast pointers approach. He was satisfied with my approach.
Step 3 : I wrote the optimized code.




If we are given the above binary tree as input then moving from root node(5) to the farthest leaf node(50), the path formed will be [ 5->10->25->35->40->45->50 ]. The total number of nodes encountered is 7, therefore the maximum depth of the binary tree is 7.
1. If tree is empty then return -1
2. Else
(a) Get the max depth of left subtree recursively i.e.,
call maxDepth( tree->left-subtree)
(a) Get the max depth of right subtree recursively i.e.,
call maxDepth( tree->right-subtree)
(c) Get the max of max depths of left and right
subtrees and add 1 to it for the current node.
max_depth = max(max dept of left subtree,
max depth of right subtree)
+ 1
(d) Return max_depth
It was a basic round to check computer fundamentals.
Scheduling algorithms
Dispatcher
Mutex , Semaphores
Banker's Algorithm
Tip 1 : Read Galvin for OS thoroughly and Navathe for DBMS.
Tip 2 : Make your own notes and try to revise them before the interview.
Tip 3 : Try running unix commands and SQL queries
Basic HR questions

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?