Sudoku is a number-placement puzzle. The objective is to fill a 9 x 9 grid with digits so that each column, each row, and each of the nine 3 x 3 sub-gri…
A deleted cluster jackknifed sample is created by filtering out (deleting) clusters of data, where d is the percent of clusters removed at random. 这道题考察…
You are working for a local supply company. You have shelves of the same width shelf_width and several types of boxes with widths box_widths[] . You’re…
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…
Input: [1 10 6 7 9 8 2 4 3 5] Output: How many people can the last one in line see? Clarification: A person A can see another person B in front of them…
Given a log of website requests, where each line contains an entry with the following fields (time, customerId, pageVisited) , write an algorithm to fin…
How do you write a SQL query to find duplicate records in a table and how do you remove them? 这道题考察的是 SQL 中重复数据的查找与清理,核心思路通常是先按业务键分组统计重复行数,再结合窗口函数或自连接定位…
1. Explain what the code does. 2. Write test cases and check for any bugs. 3. Explain the purpose of the StringBuilder class in this code. You are given…
Stripe in Brazil is obliged to register customer transactions for each merchant with the central bank as an aggregated unit per day. These are called re…
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[] = {…
We are trying to create a video game in which aliens are attacking a friendly base. You can imagine the base to be a 1D line that goes from 0 to 10. The…
Background This is a small codebase related to mazes. It has some basic utilities to parse a maze from a string representation, print out a maze, and at…
Build a digital representation of a movie, where a movie has a title and an optional rating between 1 and 5. Also add a way to rate a movie after creati…
Given the following 2D Bounding Box struct, write a function to merge n bounding boxes together, and return a final bounding box with the result. struct…
Given a binary tree, find the maximum path sum from any two alive nodes within the tree. We can assume a node is an alive node if and only if it is a le…
Login Form Exercise This is an incomplete login form. Do not add any additional HTML elements. The login() service works as follows: Accepts an email an…
Given a stream of data points ( * ), find the p50 and p95. [** **** * *** ****** **********] p50 = **** p95 = ****** 这道题考察的是对数据流实时计算百分位数(P50、P95)的能力。核心思…
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…