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…
Given an array of integers, return the index of one of the largest elements, chosen uniformly at random. Example: index: 0 1 2 3 4 5 6 array: [5, 3, 6,…
Build a data structure for storing integers. You will not persist the database to disk; you will store the data in memory. For simplicity’s sake, instea…
Design Ticket Master Design a ticketing system for managing events and selling tickets. The system should support creating events, listing available tic…
There are 3 tables in the database. Application : stores customer application information. AppStatusDesc : lookup table for application status. ProductD…
Implement a class, RateLimiter , which wraps a given function, allowing it to be called no more than once every n milliseconds. TODO: Implement this cla…
In Google Shopping, we have products identified by a unique id. Each product can have multiple offers associated with it, and each offer has a correspon…
A binary matrix only has 0 or 1. For every element in the matrix, find the minimum number of steps to reach 1 (left, right, down, up). Input: [ [0, 1, 0…
Coding 1 You are given an array of integers nums and an integer k . Return the k most frequent elements in the array. 这道题要求从整数数组中找出出现频率最高的前 k 个元素。核心思路通常…
You are an engineer on the TensorRT team tasked with developing algorithms for inference on neural networks. A customer has provided a list of networks…
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digit…
Given an integer array nums and an integer k , return the k -th largest element in the array. Note that it is the k -th largest element in the sorted or…
Build a basic Flask app. This is a basic Python HTTP server to track flight tickets and their prices. Your interviewer will explain the question to you;…
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…