Two integer operations are defined as: ADD_1 : Increment the integer by 1 MULTIPLY_2 : Multiply the integer by 2 Given an integer value k , determine th…
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…
Given a set of transactions between users and an initial balance per user, output the final balance per user. Note that each transaction denotes the pay…
Weather Challenge Information For this interview, we’d like you to add some new functionality to an existing system. There are a few things we’d like to…
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…
You are given a network of n nodes represented as an n x n adjacency matrix graph , where graph[i][j] == 1 means the two nodes i and j are connected, an…
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…
Cache Design Design a cache that supports the following two basic operations: set(id, object) : store an object by its id; get(id) : retrieve an object…
You will design and build a word predictor. This word predictor will take some text as training data. You need to provide an API which accepts a word as…
Imagine you have a robot that sends status messages that humans will read in real time. The raw messages are hard to read for a human because there are…
Given a string containing characters ( and ) , find the length of the longest valid parentheses substring. 这道题要求在只包含左括号和右括号的字符串中,找出最长的有效括号子串长度。常见做法是使用栈来…
Maximum Operations Description Given a string s of lowercase English characters, the following operation can be performed on it any number of times. Cho…
Modify your program such that it can find shipping routes through at most one intermediate country. Any shipping methods are allowed. Output the route,…
Given an array of meeting time intervals intervals where intervals[i] = [starti, endi] , return the minimum number of conference rooms required. Impleme…
Design an airplane flight system with customers. 这道题本质上是一个系统设计题,重点在于围绕“航班”和“乘客”建立清晰的数据模型与操作接口。通常需要考虑航班信息、座位分配、客户预订、取消与查询等核心功能,并保证在并发或状态更新时数据一致性。解题时可以先抽象…
Scenario A researcher previously submitted a report to Product Security that initially seemed like a security issue. After engaging the engineering team…