Tip 1 : Practice Data Structures and Algorithms from Coding Ninjas website and GeeksforGeeks.
Tip 2 : Give coding contests regularly so as to maintain your speed to code, (Leetcode is recommended for weekly contests)
Tip 3 : Do atleast 2 projects and think about all possible questions about them that can be asked during an Interview.
Tip 1 : Make your resume short and try to make it of one page only and do mention all your skills which you are confident of in your resume.
Tip 2 : You can also add your Contests rank and ratings if they are good enough.
Test consists of 4 sections:
Debugging: 7Qs and 20 mins. Overall Easy Level.
Coding: 2Qs and 70 mins, Moderate to Hard difficulty
Behavioural: 60-70 Qs and 20 minutes.
Aptitude: 24 MCQs and 35 minutes. Easy Level



If ‘N’ = 7, ‘ARR’ = { 1, 5, 2, 3, 4, 6, 7 } and ‘TARGET’ = 9
Then, there are three triplets with sum less than 9:
1) {1, 5, 2}
2) {1, 2, 3}
3) {1, 2, 4}
4) {1, 3, 4}
Thus, the output will be 4.



Note that the level order traversal must not contain any null values, simply return the tree in level order.
The interview round was scheduled at 1:00 pm, Interview was very friendly. Initially asked for my introduction and project, After that proceeded to 2 Algo-DS problems.


In this given binary tree, nodes 7, 5, and 9 are half nodes because they have only one child node. So we have to replace these nodes with their child. The inorder traversal of the updated binary tree is [1, 6, 11, 2, 4]. Hence, the answer is [1, 6, 11, 2, 4].

Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.
For example, the input for the tree depicted in the below image would be :
1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1
Explanation :
Level 1 :
The root node of the tree is 1
Level 2 :
Left child of 1 = 2
Right child of 1 = 3
Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6
Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)
Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)
The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level.
The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (-1).
The above format was just to provide clarity on how the input is formed for a given tree.
The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Step 1 : Initially I took 2 minutes to develop the approach for the problem
Step 2 : I got that I have to work in the post-order traversal.
Step 3 : Think of the time complexity correctly.



As the product of elements can be very large you need to return the answer in mod (10^9+7).
Try to do this without using the division operator ‘/’, in constant space. The output array does not count as extra space for the purpose of space complexity analysis.
I was asked for all the optimizations I can do and we discussed around 3 approaches for the same.
This round was taken by a Senior Software Development Engineer at Amazon, working in the company for more than 7 years.
He was very friendly and made me really comfortable. Initially, my intro was asked and 10 minutes discussion on one of my projects.
Then, he came on to two coding problems.



• The left subtree of a node contains only nodes with data less than and equal to the node’s data.
• The right subtree of a node contains only nodes with data greater than and equal to the node’s data.
• Both the left and right subtrees must also be partial binary search trees.

Level 1:
All the nodes in the left subtree of 4 (2, 1, 3) are smaller
than 4, all the nodes in the right subtree of the 4 (5) are
larger than 4.
Level 2 :
For node 2:
All the nodes in the left subtree of 2 (1) are smaller than
2, all the nodes in the right subtree of the 2 (3) are larger than 2.
For node 5:
The left and right subtree for node 5 is empty.
Level 3:
For node 1:
The left and right subtree for node 1 are empty.
For node 3:
The left and right subtree for node 3 are empty.
Because all the nodes follow the property of a Partial binary
search tree, the above tree is a Partial binary search tree.



Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").
I gave 3 approaches for the problem and the most optimal solution was O(n) time and O(26) space, which can be done using HASHMAPS, using Acquire and Release technique.

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?