Imagine you are building a proxy (edge layer) application API endpoint which receives a JSON payload. But you don’t know the structure of this payload….
You are given a sorted list of distinct integers from 0 to 99, for instance [0, 1, 2, 50, 52, 75] . Your task is to produce a string that describes the…
Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most one element. We define an array as non…
A data center has K computing nodes. Each node has a current load T and C CPU cores. The maximum load a single CPU core can handle is 200 , so the total…
Input is a list of numbers representing the temperature of a city in the past few years. Please compute the average and median temperature given a time…
Dict Bot We are building a small chat bot that can receive messages and keep track of what everyone has said. Given a sequence of messages, implement a…
Design a data structure that supports the following operations: push(x) : pushes an integer x onto the stack pop() : removes and returns the most freque…
Given a grid of land heights. For example: start 6 5 4 5 5 4 2 5 1 1 5 5 2 1 5 2 3 2 4 4 5 4 5 5 6 end The upper-left corner is the start cell, and the…
Systems Design – Car Share Rental App We are building a car sharing rental app that enables users who want to rent a car to find users who have personal…
Given an integer, swap at most one pair of digits to make the largest possible integer. Example: 43183 -> 83143 Swap 4 and 8. 这道题要求你只允许交换一次数字中的一对位置,使结果尽…
Write a query to find the total value of sales and the number of unique paying customers, grouped and sorted in descending order by payment type. Existi…
Design a notification system that receives notification requests and sends notifications to users through phone or email. The system should be scalable,…
Problem: Meeting Room Scheduler Background: A company has multiple meeting rooms. Employees want to book these rooms for meetings. Your task is to build…
Longest Substring Without Repeating Characters Given a string, find the longest substring that does not contain any repeated characters. Example 1: Inpu…
Given a list/array of strings, find and group together all strings that are “buddies” with one another. You may use any data structure of your choosing…
The stock span problem is a financial problem where we have a series of N daily price quotes for a stock and we need to calculate the span of the stock’…
We have a job definition as follows: from __future__ import annotations from dataclasses import dataclass from typing import List @dataclass class Job:…
No Pairs Allowed Description For each word in a list of words, if any two adjacent characters are equal, change one of them. Determine the minimum numbe…
Given an integer array nums , rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output:…
Given 2 dates in the format yyyy/mm/dd , return the number of days between them. Do not use any library; parse it manually. Consider leap years and diff…