Your team at Amazon is working on a system that divides applications to a mixed cluster of computing devices. Each application is identified by an integer ID, requires a fixed non-zero amount of memory to execute, and is defined to be either a foreground or background application. IDs are guaranteed to be unique within their own application type, but not across types.
Each device should be assi
Asked in: AMAZON
Amazon's Alexa team is working on optimizing the customer experience for scenarios where customers ask generic questions.
One example of a generic question is "What are good vegetarian restaurants nearby?"
In this example, Alexa would then search for a list of vegetarian restaurants in the city and select the nearest X vegetarian
restaurants relative to the customer's location. Given an ar
Asked in: AMAZON
A student is preparing for a scholarship test which is organized on the Amazon Academy platform and scheduled for next month.
There are n chapters to be studied where the ith chapter has pages[i] pages. In one day, the student decides to read up to p of the remaining pages, each from some k consecutive chapters. Thus, the number of pages remaining to be read is reduced by p from each of these cha
Asked in: AMAZON
Database security and authentication have become vital due to the increasing number of cyberattacks every day.
Amazon has created a team for the analysis of various types of cyberattacks. In one such analysis, the team finds
a virus that attacks the user passwords. The virus designed has an attacking rule defined by attackOrder, which is
a permutation of length n. In the ith second of the at
Asked in: AMAZON
Given two servers and the time taken to upgrade each server in seconds, denoted by t1 and t2 respectively, in one second, one server undergoes the upgrade process. The servers receive requests at certain time intervals and pause upgrades during those seconds. The servers receive requests at multiples of req1 and req2 respectively. Determine the minimum total time (in seconds) required to upgrade
Asked in: EXPEDIA
Given a set of nodes and a list of connected pairs, determine the order (number of nodes) in each connected component in the graph. For each component, calculate the ceiling of the square root of its order, and return the sum of these values across all connected components.
Example
graph_nodes = 10
graph_from = [1, 1, 2, 3, 7]
graph_to = [2, 3, 4, 5, 8]
There are graph_edges = 5 ed
Asked in: UBER
Amazon is working on optimizing its delivery zones to ensure efficient and timely delivery of packages.
Each delivery zone is represented as an interval indicating the range of house numbers it covers.
The delivery zones can overlap.
Given is a list of n delivery zones, where the i-th zone covers the interval (a[i], b[i]) (inclusive).
Additionally, given is a maximum allowed length, k,
Asked in: AMAZON
The Amazon Alexa development team needs to analyze request logs across numSkills different Alexa skills to ensure optimal performance and user engagement.
The skills are indexed from 1 to numSkills, and the logs are provided as a 2D array requestLogs of size m, where requestLogs[i] = [skill_ID, timeStamp] denotes that a request was made to the skill with ID skill_ID at the time timeStamp.
Yo
Asked in: AMAZON
1. Unique Decimal Count
Given a binary string consisting only of '0's and '1's, determine how many unique decimal values can be represented by all possible non-empty subsequences of the string.
Notes:
- The binary string may include leading zeros.
- A subsequence is formed by deleting some characters (possibly none) without changing the order of the remaining characters.
Example: "ace"
Asked in: GOOGLE
Implement a function that returns the minimum number of operations needed to ensure the string s (of length n) contains no segments of exactly m consecutive '0's.
In one operation, you can do the following:
- Select a contiguous segment of length k and make every bit in this segment '1'.
The function getMinOperations will take three inputs:
- string s: a string representing s.
- int m: an
Asked in: AMAZON