CS-OA cs-vo Faang

Amazon NG OA – Amazon 笔试 – Amazon 笔试真题 – Calculating Maximum Aggregate Temperature Change – dentifying Idle Robots in a Warehouse Grid

I've had my Amazon NG OA today(70 minutes with 2 coding questions).

Code Question 1: Calculating Maximum Aggregate Temperature Change

Alexa is Amazon's virtual AI assistant. It makes it easy to set up your Alexa-enabled devices, listen to music, get weather updates, and much more. The team is working on a new feature that evaluates the aggregate temperature change for a period based on the changes in temperature of previous and upcoming days.

Taking the change in temperature data of n days, the aggregate temperature change evaluated on the i-th day is the maximum of the sum of the changes in temperatures until the i-th day, and the sum of the change in temperatures in the next (n-i) days, with the i-th day temperature change included in both.

Example: temperatureChange = [6, -2, 5]

The aggregate temperature change on each day is evaluated as shown in a detailed explanation, showing how the sum is calculated for day 1 and day 2, and then the maximum aggregate temperature change is determined.

Code Question 2: Identifying Idle Robots in a Warehouse Grid

Amazon uses small, Roomba-shaped robots, called "Drives". They deliver large stacks of products to human workers by following set paths around the warehouse.

The warehouse can be represented in the form of a Cartesian plane, where robots are located at integral points of the form (x, y). When a product is to be delivered to some point (i, j), the nearest robot is sought and chosen. Thus if a robot is surrounded by other robots nearby, it will seldom be chosen for work. More formally, a robot is said to be idle if it has a robot located above, below, left, and right of it. It is guaranteed that no two robots are at the same location.

Example: The x and y coordinates are given as two arrays, with the coordinates aligned by index: x = [1, 1, 2, 2, 2, 3, 3] and y = [1, 2, 3, 1, 2, 3, 1].

The 10 robots are arranged as follows, showing their positions on a grid, and the task is to find the number of idle robots.

These coding questions involve algorithms for processing temperature change data and locating idle robots based on their grid positions.

我们提供OA代写服务,代面试服务,面试辅助服务等。对于OA代写我们将确保你获得满分,联系我们立即进行预约。

We provide services for writing online assessments (OA), proxy interviews, and interview assistance. For the OA writing service, we will ensure that you achieve a perfect score. Contact us now to make an appointment.

Leave a Reply

Your email address will not be published. Required fields are marked *