A new Amazon intern encountered a challenging task. Currently, the intern has n integers, where the value of the i th element is represented by the arra…
Moving Median Given an array of integers, return the moving median for each element based on the element and its N-1 predecessors, where N is the slidin…
There are K computing nodes in a data center. The current load of the i -th node is T[i] , and the node has C[i] CPU cores. Each CPU core can carry at m…
Given a matrix of size m x n , m denotes the row starting with index 0 and n denotes the column starting with index 0. The elements in the matrix are po…
1. Profitable Project Pairs In a tech company, there are n projects available for the team to work on. Due to resource constraints, they can only work o…
SQL: Combining Successful and Failed Transactions Analysis A financial technology service is conducting a comprehensive analysis of its transactions to…
A student is preparing for a test from Amazon Academy for a scholarship. The student is required to completely read n chapters for the test, where the i…
Implement the function remaining_leaves(n, m, leaves, winds) which takes as inputs the integers n and m , the 2D integer array leaves , and the string w…
AWS provides scalable systems. A set of n servers are used for horizontally scaling an application. The goal is to have the computational power of the s…
1. Heap Operations Complexity A heap is a special type of binary tree in which every parent node is less than or equal to its child node(s) (min-heap) o…
String Patterns Given the length of a word wordLen and the maximum number of consecutive vowels it can contain maxVowels , determine how many unique wor…
Data scientists at Amazon are working on a logistics optimization tool to arrange delivery routes based on existing route patterns. A prototype algorith…
Calculus – Integration – Fixed Compute the integral ∫ from -π to π of (3 + 2 sin x + 3 cos x)(1 + 4 sin x) dx Pick ONE option: 7π 8π 14π 16π 这道题考察定积分与三角…
Amazon OA: Minimum Boxes to Unload The supply chain manager at one of Amazon’s warehouses is shipping the last container of the day. All n boxes have be…
Write a function dirReduc that takes an array of strings and returns a string array. The returned array should have all unnecessary directions removed,…
You are given a string chatMessage . Your task is to count the number of substrings of exactly length 3 that contain at least one vowel ( a , e , i , o…
Given an array of integers and an integer k , determine the length of the longest valid subsequence in the array. A subsequence is formed by removing ze…
1. Network Sockets Consider two pseudo-code snippets illustrating file transfer mechanisms between a client and a server. Pseudo-code 1 Client: file = o…
1. Handling High Concurrency in Web Server Your web server at TikTok needs to handle a high number of concurrent connections efficiently. Which server a…
The manager of the Amazon warehouse has decided to make changes to the inventory. Currently, the inventory has n products, where the quality of the i -t…