Data Stream LeetCode Problems: All 21, With Python Solutions

Every problem in this library that LeetCode tags Data Stream 21 in total, 14 of them with a complete Python solution, a worked example and the time and space complexity of the approach.

  • 21 problems
  • 6 Easy
  • 9 Medium
  • 6 Hard

Data Stream problems by difficulty

Problems with a complete Python solution are listed first, then by ascending problem number.

Easy (6)

#ProblemDifficultyTopics
703Kth Largest Element in a StreamEasyTree, Design, Binary Search Tree +3
933Number of Recent CallsEasyDesign, Queue, Data Stream
1656Design an Ordered StreamEasyDesign, Array, Hash Table +1
170Two Sum III - Data structure designPremiumEasyDesign, Array, Hash Table +2
346Moving Average from Data StreamPremiumEasyDesign, Queue, Array +1
359Logger Rate LimiterPremiumEasyDesign, Hash Table, Data Stream

Medium (9)

#ProblemDifficultyTopics
901Online Stock SpanMediumStack, Design, Data Stream +1
1352Product of the Last K NumbersMediumDesign, Array, Math +2
1472Design Browser HistoryMediumStack, Design, Array +3
1670Design Front Middle Back QueueMediumDesign, Queue, Array +2
2034Stock Price FluctuationMediumDesign, Hash Table, Data Stream +2
2526Find Consecutive Integers from a Data StreamMediumDesign, Queue, Hash Table +2
362Design Hit CounterPremiumMediumDesign, Queue, Array +2
1429First Unique NumberPremiumMediumDesign, Queue, Array +2
1500Design a File Sharing SystemPremiumMediumDesign, Hash Table, Data Stream +2

Hard (6)

#ProblemDifficultyTopics
295Find Median from Data StreamHardDesign, Two Pointers, Data Stream +2
352Data Stream as Disjoint IntervalsHardUnion Find, Design, Hash Table +3
1032Stream of CharactersHardDesign, Trie, Array +2
1825Finding MK AverageHardDesign, Queue, Data Stream +2
2102Sequentially Ordinal Rank TrackerHardDesign, Data Stream, Ordered Set +1
642Design Search Autocomplete SystemPremiumHardDepth-First Search, Design, Trie +4

When the Data Stream problem arrives live

Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.