Tip 1 : Focus on Data Structures and Algorithms skills
Tip 2 : Always prepare for Amazon behavioural Interview Questions
Tip 1 : Mention Projects to show your development skills
Tip 2 : Be prepared with everything whatever you had mentioned on your Resume
I got a link on 24 January and they give me time of 5 days to attend the test, anytime between these dates.



The distance between two points on a plane is the Euclidean Distance.
If N = 2, K = 1 and the points are {2,3}, {-1, 2}.
Then the distance of the first point from the origin is sqrt((2 - 0) ^ 2 + (3 - 0) ^ 2) = sqrt(13).
The distance of the second point from the origin is sqrt((-1 - 0) ^ 2 + (2 - 0) ^ 2) = sqrt(5).
Can you solve this in O(N log K) time complexity?
1- By reading the Question you will understand that here priority queue is used
2- I had calculated the distances from origin and maintain priority queue,which contain values of k closest point's and atlast store these points as result.



ARR = [0, 1, 1, 0, 0, 1, 1, 1], here you can see the maximum length of consecutive 1’s is 3. Hence the answer is 3.
This Question is based on Sliding window Approach.
This is Telephonic round, never expected that they ask in such a depth on this round



Serialization is the process of translating a data structure or object state into a format that can be stored or transmitted (for example, across a computer network) and reconstructed later. The opposite operation, that is, extracting a data structure from stored information, is deserialization.
I had used level order traversal first, but was not accepted by Interviewer then I told him preorder traversal technique. Here first I had converted tree in string form and then again convert it in binary tree using stringstream and getline functions



A Binary Search Tree is a binary tree data structure with the following properties:
The left subtree of any node contains nodes with a value less than the node’s value.
The right subtree of any node contains nodes with a value equal to or greater than the node’s value.
Right, and left subtrees are also binary search trees.
It is guaranteed that,
Values of all nodes in the given binary search tree are distinct positive integers.
There will be only one unique set of ‘K’ values in the binary search tree that is closest to the ‘target’.
I already faced similar problem in Online Assessment, so I solved it using priority queue and code it easily.
1 Question is asked based on Dynamic Programming



First I told him recursive and Memorization techniques to Interviewer and he is satisfied. After that, I told him greedy Approach which was failing for few test cases and I had taken lot of time to think DP Approach,but atlast I told him the gap technique of dp and solved the Question
SDE-2 had taken this round, no behavioural questions, directly jump to coding section



If ‘S’= “great” and ‘W’= “tagre”, ‘S’ can be rearranged to form ‘W’.
‘S’ = “gre” + “at” (We choose to swap ‘X’ & ‘Y’)
‘S’ = “at” + “gre”
Now letting “gre” as it is and applying operation on “at”.
‘S’ = “a” + “t” + “gre”
Swapping “a” and “t”
‘S’ = “t” + “a” + “gre”
Therefore ‘S’ can be rearranged into ‘W’.
Both strings are of the same length and operations can only be applied to string ‘S’.
Told her hashmap and Priority queue Approach and she was satisfied with Solution



If the dictionary consists of the following words:-
["caa", "aaa", "aab"], and 'K' is 3.
Then, the order of the alphabet is -
['c', 'a', 'b']
If the language consists of four letters, the four letters should be the starting four letters of the English language.
However, their order might differ in the alien language.
When she told me this question, initially I don't understand the question, then she again told me and explain the problem in polite way. I got the Approach, topological sort and told her Approach, she ask few questions regarding topo sort,then asked me code Question and I coded it correctly.
Interviewer joined call after 5 minutes and he was also facing some network issues, I told him about this and he switch off his camera and ask me few behavioural questions, I had answered them as I was already prepared for them.
Then,he moved to coding problem and wanting from me to directly write the code without explaining and Problem is quite hard, so I told him please give me little bit of time as I didn't get the problem in first go.
But he was in hurry, didn't give me proper time and Over the Interview just after 35 Minutes.
Design Autosearch complete System
Told the Trie Approach and took time to come with this Approach as it was not a easy problem, but Interviewer was in hurry, so unable to code the problem.

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?