Create an online match-making algorithm that receives players and dispatches a call to a game server when it finds players with ratings close enough to…
Build a React app that displays a counter starting at 0 . Requirements: Show the text You clicked {count} times . Render a button labeled Click Me . Whe…
You are given a list of calls, where each call has a type such as search , tts , or db.lookup . Each call type has a cooldown period. There are m time s…
Given an unsorted list of products with their departments and a shopping list, return the time saved in terms of the number of department visits elimina…
Given a string S consisting of lowercase English characters, determine if you can make it a palindrome by removing at most 1 character. Examples: tacoca…
Given an array of integers (0 to 9), rearrange the positions of the array elements to represent the second largest possible number. Example 1: Input: [1…
X = player1, Y = player2. Given a 2D matrix and a position, return whether one of the players is surrounded by the other player. 这道题的核心是把二维矩阵中的“包围”关系转化为…
Network of routers: each router has an (x, y) coordinate. A message can be broadcast from one router to another if the Euclidean distance between them i…
Given an array of positive integers nums and an integer k , return true if nums has a continuous subarray whose sum equals k . Examples: nums = [1,2,3,4…
Question 1: You are given two arrays with positive integers arr1 and arr2 . A prefix of a positive integer is an integer formed by one or more of its di…
Implement a mock of the Unix cd (change directory) command. The code does not have to change actual directories; it only needs to return the new path af…
Design a system that supports the following operations: A user can create a new post and attach one or more hashtags to it. A user can search for posts…
Design a String Compress(string input) system. The system should support compressing an input string and later decompressing it back to the original for…
Amazon wants to build a lottery system. When a customer purchases items worth between $1 and $100, they are entered into the lottery. Customers who purc…
An application running on Linux used to process 1000 requests per second. Now it is only processing 2 requests/second. How will you troubleshoot this is…
Problem Description We have a currency exchange requirement. Now we need to convert CNY to USD and hope to get as much USD as possible. Multiple exchang…
Amazon is releasing a feature called “Stuff Your Friends Are Buying” . Implement a function that returns stuff that a person’s friends are buying that t…
Write a program which takes an array of strings and a set of strings, and returns the starting and ending indices of a shortest subarray of the given ar…
When a consumer places an order with DoorDash, our ETA system provides them with an estimated delivery time window, for example, 5 minutes ~ 15 minutes…
Simulate a game on a 2D grid that is infinite to the left, right, and top, but bounded at the bottom. There are two players: Red, represented by R , and…