Determine if an undirected graph has cycle. Example 1: [[1,2],[1,3],[2,3]] -> return true Example 2: [[1,2],[2,3],[3,4],[1,5]] -> return false 这道题要求判断一个…
Find first non-repeated character in a string. Examples: AAABBBC , returns C . AAABBBCD , returns C . ABABABCD , returns C . 这道题要求在字符串中找出第一个只出现一次的字符,并返回…
Given a string s containing only lowercase English letters and parentheses, reverse the strings in each pair of matching parentheses from the innermost…
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.” ->…
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 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…
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…
Amazon frequently offers product bundles to customers, where multiple related products are combined and sold together at a discounted price. The goal is…
Auction feature on Instagram People can create auction posts and add products People can bid on products When the auction ends, people can buy the produ…
You are running a reservation-only restaurant. You already know how many parties have booked for today, and you need to arrange the required number of t…
Write a program that allows the user to calculate the price of a pizza. A pizza has: a base a size toppings Assume the system stores everything in memor…
You’re creating a change counting system for a new automated Amazon cash register that Amazon plans to launch internationally. Your change counting syst…
Given an array of meeting time intervals intervals where intervals[i] = [starti, endi] , return the minimum number of conference rooms required. Impleme…
Design Ticket Master Design a ticketing system for managing events and selling tickets. The system should support creating events, listing available tic…
Question 1 There are n people at a party. Some of them are friends and others are strangers. A person naturally moves to create or join a group containi…
There is a company which has a CEO and a hierarchy of employees. All employees have a unique ID, name, and a pointer to their manager and their reports….
The feature recommends a set of products that you have not already purchased, from the things that your friends have bought, in order from most bought t…