There are a total of numCourses courses you have to take, labeled from 0 to numCourses – 1 . You are given an array prerequisites where prerequisites[i]…
Given a mapping of teams to their data access patterns, and a list of deleted data files, determine which teams are impacted. Build a system that can: P…
Compare two strings and determine whether they are anagrams of each other. 这道题的核心是判断两个字符串是否由完全相同的字符组成,只是顺序不同。最常见的做法是先比较长度是否一致,如果长度不同就一定不是 anagram;然后用哈希表…
Design a rate limiter for an API. Discuss the functional requirements, non-functional requirements, API design, high-level architecture, and data model…
Write a function that takes in a string and decreases all monetary values in the string by 15%. Examples: // “I spent $100.00 on Amazon this week.” ->…
TikTok is hosting a livestream event with popular creators. Each creator has submitted their preferred start and end times for their part in the livestr…
Write a function to accept two arguments: Arg1 being an integer array and Arg2 being an integer. Find all the pairs from Arg1 whose difference is equal…
Given an array of data, where each entry is an object with id and value keys, and an object of ids, where each key is the name and value is either a sin…
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…