Amazon SDE2 | Screening Round
Hi All,
Last week I gave the screenin round interview for Amazon SDE-2. Here are the questions asked.
Q1 - Amazon's manufacturing plant is located in Seattle. The products are transported from the manufacturing plant to the city within some d days in a bus. There is the transportation line within manufacturing plant on which products are kept and individual products have the weights which is represented by the weight[i]. Each day the bus is loaded with the products of the transportation line .We may not load more weight than the maximum weight capacity of the bus.
As the traffic rules are very strict against overloading of the buses in Seattle, Amazon wants to build the software that can find the the least weight capacity of the bus that will result in all the products on the transportation line being transported to the city within d days.
Input: Products weights = [20,10,30,40], days =2
output 60
Input :
Products weights = [1,2,3,4,5,6,7,8,9,10], days =5
Solution - This was a typical Binary search question similar to rotting oranges. I gave the working code in first 10 minutes and then took around 10-12 Minutes to dry run on 2-3 test cases.
Q - 2 Serialise and deserialise a binary tree
def serialise(TreeNode root): string
def deserialise(String result): Tree
Solution -
For Serialise - I told the pre-order traversal.
For Deserialise - I told the recursive solution by splitting the string
He just asked the approach and didn't needed the code.
Resulted - Rejected, I am not sure why because everything went fine. The interviewer was in hurry and joined 10 mins late and left 10 mins early as he told he was having scrum call.


