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…
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….
You are given a starting location and a list of resort names. In this interview, you should access the Maps APIs through the provided proxy. If you woul…
Given an array of meeting time intervals consisting of start and end times [s1, e1], [s2, e2], …, determine if a person could attend all meetings with…
Imagine you have an RPC server that produces a log of entries, and you’re analyzing it offline. There are two entries for each call: one when the RPC st…
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…
Interleaving Streams We are building a page that pulls posts from multiple different sources and displays them in a unified feed. You are going to build…
Maximum Product Subarray Given an integer array nums , find the contiguous subarray within the array that has the largest product, and return the produc…