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
The manager of an Amazon warehouse needs to ship n products from different locations, the location of the th product is represented by an array locations[i]. The manager is allowed to perform one operation at a time. Each operation is described below
- If the inventory has two or more products. the manager can pick two products x and y from the inventory if they have different locations. i.e. l
Asked in: AMAZON
There are m cities in a 1-dimensional country, where each city is represented by an integer between 1 through m. There are n Amazon warehouses, where the ith warehouse can deliver to cities in the
range cityStart[i] to cityEnd[i] for better delivery management.
For example, if there are m = 10 cities, and n = 2 warehouses cityStart = [3, 1] and cityEnd = [10, 5] then the first warehouse deliv
Asked in: AMAZON
Count comparisons
You are given a 2-D matrix M of dimensions N x D. You have to decide ranking based on the given matrix, rankings are defined as follows:
- Index i is said to be ahead of index j in rankings if the first index at which element value differs in row M[i] and M[j] has a greater value in row M[i].
- If for index i and index j, all the elements in row M[i] and M[j] are the same,
Asked in: GOOGLE
Circular path -
You are given the following:
- Two integers N and K
- Two arrays of integers A and B of size N.
Consider N circular paths. The i-th circular path has the center at the coordinate (A[i], B[i]) and radius K.
There are Q queries. Each query consists of two integers L and R. For each query, Alice starts from the L-th circular path and she needs to know whether she can reac
Asked in: GOOGLE
Remaining elements
You are given two arrays A and B of size N. Your task is to remove some numbers from array A such that the following conditions are met:
1. The remaining elements of array A are strictly increasing from left to right.
2. The corresponding elements from B must also be extracted. For example, if you have removed the ith element of array A, then the ith element of array B mu
Asked in: GOOGLE
Key Generation Vulnerabilities: Finding the Least Vulnerability Factor with Modifications
2. Code Question 2
The developers at Amazon IAM are working on identifying vulnerabilities in their key generation process. The key is represented by an array of integers, where the h integer is denoted by key[i]. The vulnerability factor of the array (key) is defined as the maximum length of a subarray t
Asked in: AMAZON