Debugging: Dasher Picking for Deliveries Description We have some code that attempts to assign a random dasher to a delivery: There is a class Dasher th…
Given a set of lockers that can be one of three sizes: s , m , l , and boxes that can be one of three sizes: s , m , l , implement the assignLockerToBox…
We’ve provided a labeled training set for a fraudulent booking model. Each record is a historical Airbnb booking and its corresponding characteristics (…
Given a sequence of integers and an integer total target, return whether a continuous sequence of integers sums up to target. Example: [1, 3, 1, 4, 23],…
Implement bill_for(month, plan, users) to calculate the monthly bill for a customer. The bill depends on how many users are active during the given mont…
Given a 2-dimensional 2-color bitmap, write a function to implement flood fill , e.g. the bucket in MS Paint. Assume that the fill will only fill white…
Find all palindromes in a string. 这道题要求在一个字符串中找出所有回文串,核心通常是枚举每一个可能的回文中心,并向两边扩展检查,这样可以同时处理奇数长度和偶数长度的回文。也可以结合动态规划或 Manacher 算法来进一步优化,但面试中最常见、最稳妥的方法是中心扩展:对…
Given k calendars, a meeting duration, and bounds, return a list of possible time slots where the meeting can be scheduled. Input timeout: 3 Input log:…
You are working on a project that has to implement a new ship-discovering technology. You are provided with the function: struct Point { const int x; co…
Parse log file. Count the number of errors and group them by time. 这道题的核心是先逐行解析日志,再从每一行中提取错误标记和时间信息,最后按时间维度进行分组统计。通常可以用哈希表或字典保存每个时间段对应的错误数量,边扫描边累加,避免重复遍…
You work on a project that has to implement a new ship discovering technology. You are provided with the following function: struct Point { const int x_…
You are given an integer array bills representing bills of different denominations and an integer amount representing a total amount of money. Return th…
Amazon frequently offers product bundles to customers, where multiple related products are combined and sold together at a discounted price. The goal is…
Implement a function that takes numbers a and b in string form and returns the result of a * b as a string. The input can only contain digits [0-9] or a…
Given a Binary Search Tree (BST) and a positive integer k , find the k th largest element in the Binary Search Tree. For example, in the following BST,…
We are working on a security system for a badged-access room in our company’s building. Given an ordered list of employees who used their badge to enter…
Assignment: Write a piece of code which takes a single-channel grayscale image as an input and rotates it by 90 degrees. 这道题要求对一张单通道灰度图像进行 90 度旋转,本质上是对二…
Consider streaming services like Max, Netflix, and Hulu. The companies developing these services provide media content to a wide array of users on diffe…