面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
数据流的中位数
Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.
数据流中的第 K 大元素
Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…
股票价格跨度
Design an efficient algorithm using stacks to calculate the stock span for daily price quotes.
最近的请求次数
The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…
字符流
Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…
最后 K 个数的乘积
Design a data structure to efficiently return the product of the last k numbers in a dynamic integer stream using prefix…
设计浏览器历史记录
Implement a browser history tracker with back, forward, and visit operations using linked-list pointer manipulation effi…
设计有序流
Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…
设计前中后队列
Implement a queue that efficiently handles push and pop operations at the front, middle, and back using pointer manipula…
求出 MK 平均值
Find the MKAverage of a stream of integers using a queue-driven approach with efficient state management.
股票价格波动
Design an efficient algorithm for managing stock price fluctuations with incorrect and unordered data in a data stream.
序列顺序查询
Track rankings of locations with names and scores, adding new locations and retrieving top-ranked ones efficiently.
找到数据流中的连续整数
Design a data stream checker to identify consecutive integers from a stream, focusing on handling state transitions effi…