题库chevron_right分类chevron_right数据流
label

数据流

13 道题目
简单: 3中等: 6困难: 4

数据流 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

#题目难度
295

数据流的中位数

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

困难
703

数据流中的第 K 大元素

Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…

简单
901

股票价格跨度

Design an efficient algorithm using stacks to calculate the stock span for daily price quotes.

中等
933

最近的请求次数

The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…

简单
1032

字符流

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

困难
1352

最后 K 个数的乘积

Design a data structure to efficiently return the product of the last k numbers in a dynamic integer stream using prefix…

中等
1472

设计浏览器历史记录

Implement a browser history tracker with back, forward, and visit operations using linked-list pointer manipulation effi…

中等
1656

设计有序流

Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…

简单
1670

设计前中后队列

Implement a queue that efficiently handles push and pop operations at the front, middle, and back using pointer manipula…

中等
1825

求出 MK 平均值

Find the MKAverage of a stream of integers using a queue-driven approach with efficient state management.

困难
2034

股票价格波动

Design an efficient algorithm for managing stock price fluctuations with incorrect and unordered data in a data stream.

中等
2102

序列顺序查询

Track rankings of locations with names and scores, adding new locations and retrieving top-ranked ones efficiently.

困难
2526

找到数据流中的连续整数

Design a data stream checker to identify consecutive integers from a stream, focusing on handling state transitions effi…

中等

关联高频模式

LeetCode 数据流题型题解:13题训练路线