Q1 Given a sum of money, compute the minimum number of bills and coins that equal that sum. Assume you only have the following denominations: Bills: 20,…
Your task is to write a function that, given a distance d and a stream of floating-point values received one at a time, checks for groups of three value…
Create an employee directory structure that stores employee information for a company. Include manager direct reports. Implement the following functions…
You are asked to design a playlist shuffle system that keeps track of the last N played songs and ensures that a new song is not played again until N ot…
Oncall shifts of people with start and end time Name | Start | End Adam | 10 | 100 Ben | 50 | 70 Cathy | 150 | 300 Diane | 60 | 120 We give a start and…
Imagine something like Ticketmaster or StubHub: the goal is to allow customers to book event tickets anytime, anywhere. 这道 Amazon VO 题本质上是在考一个在线购票平台的高层设…
The stock span problem is a financial problem where we have a series of N daily price quotes for a stock and we need to calculate the span of the stock’…
Word Search Collection Given a grid of letters and a list of words, return all words from the list that can be formed in the grid. Words can be formed b…
Given a string text and a list of words word_bank , insert spaces into text to construct all possible sentences where every word is found in word_bank ….
Given a file of currency conversion rates, write a function that converts one currency to another. Sample log file entries: {“from”:”USD”, “to”:”EUR”, “…
You’re working at Amazon retail and you’re in charge of implementing a method/function to be used by the promotions team to apply a discount to each ind…
Given coordinates of data centers (an array of points on a 2D plane), find the minimum length of cable required to connect all data centers. Example: DC…
We are in charge of designing a system to install packages. We are required to support the installation of a package and all of its dependent packages….
An Amazon pickup location has a set number of lockers in which boxes are dropped off and picked up. Boxes can come in many different sizes. Lockers come…
Given two integer arrays nums1 and nums2 , find their intersection. Example 1: nums1: [1, 2, 3, 4] nums2: [1, 2] result: [1, 2] 这道题要求找出两个整数数组的交集,核心思路通常是…
Let’s create a music playlist manager for Amazon Music, which allows users to: add songs to the playlist play a song from the playlist in order Implemen…
Given a log of website requests, where each line contains an entry with the following fields (time, customerId, pageVisited) , write an algorithm to fin…
Sliding Window Maximum Given an array arr[] and an integer K , find the maximum value in every contiguous subarray of size K . Example: Input: arr[] = {…
Given an m x n 2D binary grid grid which represents a map of ‘1’ s (land) and ‘0’ s (water), return the number of islands. An island is surrounded by wa…
You are given a string consisting of the letters x and y , such as xyxxxyxyy . In addition, you have an operation called flip , which changes a single x…