Write a function which, given an array of integers, returns the length of the longest subsequence where every next value is 1 bigger than the previous o…
Given a binary tree (pointer to the root), a target node anywhere in the tree, and an integer value K , return a list of the values of all the nodes tha…
You’re given an R-by-C array of integers that represents a top-down map of a building construction site, where each location in the array represents a o…
Systems Diagram Do not spend time trying to make this pretty. It is just a tool to understand your thought process and have a shared understanding of th…
You need to implement a function that fuses batch normalization layers within a PyTorch Sequential module. To be more precise, the objective is to merge…
Implement a simple event system with two operations. public interface Callback { void run(); } class Event { void registerCallback(Callback cb) { // fil…
Can You Reach the Last Traffic Light? distances = [10, 17, 25] traffic lights distance clock = [3, 5, 10] each has a clock max_time = 1200 car in zero,…
Sudoku is a number-placement puzzle. The objective is to fill a 9 x 9 grid with digits so that each column, each row, and each of the nine 3 x 3 sub-gri…
A deleted cluster jackknifed sample is created by filtering out (deleting) clusters of data, where d is the percent of clusters removed at random. 这道题考察…
You are working for a local supply company. You have shelves of the same width shelf_width and several types of boxes with widths box_widths[] . You’re…
Let’s create a music playlist manager for Amazon Music, which allows users to: add songs to the playlist play a song from the playlist in order Implemen…
Input: [1 10 6 7 9 8 2 4 3 5] Output: How many people can the last one in line see? Clarification: A person A can see another person B in front of them…
Given a log of website requests, where each line contains an entry with the following fields (time, customerId, pageVisited) , write an algorithm to fin…
How do you write a SQL query to find duplicate records in a table and how do you remove them? 这道题考察的是 SQL 中重复数据的查找与清理,核心思路通常是先按业务键分组统计重复行数,再结合窗口函数或自连接定位…
1. Explain what the code does. 2. Write test cases and check for any bugs. 3. Explain the purpose of the StringBuilder class in this code. You are given…
Stripe in Brazil is obliged to register customer transactions for each merchant with the central bank as an aggregated unit per day. These are called re…
Sliding Window Maximum Given an array arr[] and an integer K , find the maximum value in every contiguous subarray of size K . Example: Input: arr[] = {…
We are trying to create a video game in which aliens are attacking a friendly base. You can imagine the base to be a 1D line that goes from 0 to 10. The…