Preparing for an interview? Check out Cracking the Coding Interview
Published on

Amazon | SDE-1(Contract) | FTC | Bengaluru

Author
  • Shared Anonymously

Years of Experience - 1.5 years of Experience

The recruiter reached out me on LinkedIn.

I received the test link for the Online Assessment (OA),
Online Assesment
There were 2 question based on array 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:

  1. The Prime orders should be returned first, sorted by lexicographic sort of the alphabetic metadata.

  2. Only in the case of ties, the identifier should be used as a backup sort.

  3. The remaining non-Prime orders must all come after, in the original order they were given in the input.

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 question and short listed for further round

Techniacal Interview 1

  1. Started with intro from both the side
  2. There were behavioural question based on the amazon leadership prinicial: I asked something like were you been any situation, you have engaged with customer
  3. Coding question: leetcode standard question: https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii/
    Here they modified like above as inplace of 1, given it for 0

Techniacal Interview 2

  1. Started with intro from both the side

  2. There were behavioural question based on the amazon leadership prinicial: I asked something like: have you been any situation where you have to learn the outside of the scope, how you done that, and how you have applied in the work and what was the outcome of it

  3. Coding question: leetcode standard question: https://leetcode.com/problems/rotting-oranges/description/
    The above question was framed in other terms like some human and zombie story

Final Outcome: Reject
Don't know why since i was able to code both the question and explained the approch as well

ReportMark as Helpful