Find the distance between two nodes in a binary tree. The distance between two nodes is defined as the minimum number of edges to be traversed to reach…
Build a system that calculates the price of a customer’s order in a furniture store. Pricing rules are as follows: Used items get a 20% discount off the…
System Design Question: Bank Transaction Analysis System Problem Statement You are designing a system that pulls user bank transactions from external fi…
Decode String Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string] , where the encoded_string inside the square b…
Given an array of non-negative integers representing the elevations from the vertical cross section of a range of hills, determine how many units of sno…
Question Prompt Design the technical architecture of a log management system for a microservices-based application, defining the components of the syste…
Design a system which allows users to upload media and share with the world or with specific people. 这道题考察的是一个典型的系统设计题:如何支持用户上传媒体文件,并将内容设置为公开可见或仅对指定用户可见…
Two Dimensional Linked Lists You work for a package delivery company, and they need you to write code that flattens and sorts connected lists of package…
Fetch and Render Questions Question description There is an API that can return question data: https://664353ed6c6a6565870698da.mockapi.io/api/test/ques…
Find the Special Interest in Each Board You are scrolling through Pinterest and stumble upon a collection of boards. Each board is organized such that i…
Instagram College Students Visiting Search on the Day of Registration, by Country Table: ig_users This table has one row for every Instagram user. Colum…
[SQL] What are the top 10 Pop songs based on the engagement rate? Tables: song_df , fact_df Use the tables to find the 10 Pop songs with the highest eng…
Given a balanced parentheses string s , return the score of the string. The score of a balanced parentheses string is based on the following rules: () h…
Implement function to check if a key exists in a BST recursively and iteratively. Given a binary search tree, determine whether a target key is present…
Given an array of integers, find the maximum possible product of any three numbers in the array. 这道题的核心是不要只盯着最大的三个数,因为两个负数相乘可能变成正数,从而让结果更大。常见做法是一次遍历维护数组…
Given a linked list, write a function to return the top N largest elements in the list. Return the result in descending order. 这道题的核心是从一个有序或无序的链表中找出最大的前…
Given a list of current directories and a list of selected directories, return the selected directories after summarizing. Example: The entire directori…
Given a sequence S of N digits, find a subsequence of K digits such that the number formed by these K digits, in order, is the largest. 这道题要求从一个由 N 个数字组…
You are creating a website where people can track buses and figure out when to go to the station. The buses move between the stations in one direction….