Amazon | SDE-1(Contract) | FTC | Bengaluru
Company: Amazon
Role: SDE-1
Interview Stage: Onsite
Location: Bengaluru
Year: unknown
Original Post Content:
Years of Experience: 1.5 years
The recruiter reached out to me on LinkedIn.
I received the test link for the Online Assessment (OA).
Online Assessment
There were 2 questions based on arrays only:
1. Amazon is planning to release a new order prioritization algorithm to optimize fulfilling Prime deliveries on time. All orders (Prime or otherwise) are given an alphanumeric ID code. However, Prime orders are given additional metadata that consists of a space-delimited list of lowercase English letters, whereas non-Prime orders are given metadata that consists only of a space-delimited string of positive integers. Each order is therefore defined as their alphanumeric id code, followed by a space, followed by their space-delimited metadata.
You have been tasked with sorting a list of all orders in the order queue to assist in prioritization of fulfillment. They should be sorted according to the following order:
Write a function or method to return a list of strings representing the correctly prioritized orders according to this system.
Input: The input to the function/method consists of one argument: orderList, a list of strings representing all of the orders.
2. Amazon Prime Air is developing a system that divides shipping routes using flight optimization routing systems to a cluster of aircrafts that can fulfill these routes. Each shipping route is identified by a unique integer identifier, requires a fixed non-zero amount of travel distance between airports, and is defined to be either a forward shipping route or a return shipping route. Identifiers are guaranteed to be unique within their own route type, but not across route types.
Each aircraft should be assigned two shipping routes at once: one forward route and one return route. Due to the complex scheduling of flight plans, all aircraft have a fixed maximum operating travel distance, and cannot be scheduled to fly a shipping route that requires more travel distance than the prescribed maximum operating travel distance. The goal of the system is to optimize the total operating travel distance of a given aircraft. A forward/return shipping route pair is considered to be "optimal" if there does not exist another pair that has a higher operating travel distance than this pair, and also has a total less than or equal to the maximum operating travel distance of the aircraft.
For example, if the aircraft has a maximum operating travel distance of 3000 miles, a forward/return shipping route pair using a total of 2900 miles would be optimal if there does not exist a pair that uses a total operating travel distance of 3000 miles, but would not be considered optimal if such a pair did exist.
Your task is to write an algorithm to optimize the sets of forward/return shipping route pairs that allow the aircraft to be optimally utilized, given a list of forward shipping routes and a list of return shipping routes.
Input:
The input to the function/method consists of three arguments:
max TravelDist, an integer representing the maximum operating travel distance of the given aircraft;
forwardRouteList, a list of pairs of integers where the first integer represents the unique identifier of a forward shipping route and the second integer represents the amount of travel distance required by this shipping route;
return RouteList, a list of pairs of integers where the first integer represents the unique identifier of a return shipping route and the second integer represents the amount of travel distance required by this shipping route.
I was able to code both questions and was shortlisted for the further rounds.
Technical Interview 1
1. Started with intro from both sides.
2. There was a behavioral question based on the Amazon Leadership Principles: "Were you ever in a situation where you had to engage with a customer?"
3. Coding question: LeetCode standard question: https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii/
Here, instead of 1, they asked for 0.
Technical Interview 2
1. Started with intro from both sides.
2. There was a behavioral question based on the Amazon Leadership Principles: "Have you been in a situation where you had to learn something outside your scope? How did you do that, how did you apply it in your work, and what was the outcome?"
3. Coding question: LeetCode standard question: https://leetcode.com/problems/rotting-oranges/description/
The above question was framed in other terms, like a human and zombie story.
Final Outcome: Reject
Don't know why, since I was able to code both questions and explained the approach as well.