Real-Time Medians with Two Heaps: Efficient Streaming Data

23 min

Learn how to calculate real-time medians for streaming data using the two heaps method. Achieve O(1) time complexity for instant results in ad tech and analytics.

Real-Time Medians with Two Heaps: Efficient Streaming Data

More like this

podcast cover
[2dfedd3e-37ea-448b-8cb9-933921e57d86:c0000] Lecture 1: Algorithmic Thinking, Peak Finding p1-1[2dfedd3e-37ea-448b-8cb9-933921e57d86:c0001] Lecture 1: Algorithmic Thinking, Peak Finding p1-1[2dfedd3e-37ea-448b-8cb9-933921e57d86:c0002] Lecture 1: Algorithmic Thinking, Peak Finding p1-1[2dfedd3e-37ea-448b-8cb9-933921e57d86:c0003] Lecture 1: Algorithmic Thinking, Peak Finding p1-1
5 sources
Algorithmic Thinking: The Logic of Peak Finding
podcast cover
System Design Interview – An Insider's GuideBuilding MicroservicesDesigning Data-Intensive ApplicationsClean Architecture
23 sources
FIFO Queues: First In, First Out Explained
podcast cover
Design TinyURL: System Design Interview Guide for URL Shorteners - Ajit SinghBuild TinyURL - A URL Shortener at ScaleMediumDesign TinyURL: System Design Interview Guide for URL Shorteners - Ajit Singh
7 sources
Scaling TinyURL: The High-Stakes Engineering Puzzle
podcast cover
Artificial Intelligence and Generative AI for BeginnersArtificial Intelligence and Machine Learning for BusinessDesigning Data-Intensive ApplicationsHands-on Machine Learning With Scikit-learn And Tensorflow
24 sources
Data intelligence loops are replacing the data pipeline
podcast cover
Optimal IllusionsWriting High-Performance .NET CodeHow to Pass ExamsTwo Scoops of Django
24 sources
Mastering useMemo: Smart Caching Without the Overhead
podcast cover
Developing Backbone.js ApplicationsTwo Scoops of DjangoRefactoringClean Code
25 sources
React State Mistakes: Stop Storing Derived Data
podcast cover
Optimizing Massive Cashflow Files
podcast cover
System Design Interview: Design Instagram Feed | ADevGuideDesign a News Feed — Fanout, Ranking, and the Celebrity Problem | Systems Explainedkindatechnical() - Fan-Out On Write vs Fan-Out On Read Trade-OffsDesigning Instagram at Scale: Photo/Video Upload, Feed Generation, Social Graph & CDN | Md Sanwar Hossain
5 sources
Designing the Social News Feed

From Columbia University alumni built in San Francisco

BeFreed Brings Together A Global Community Of 200,000+ Curious Minds

"Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

@Moemenn
platform
star
star
star
star
star

"I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

@Chloe, Solo founder, LA
platform
comments
12
likes
117

"Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

@Raaaaaachelw
platform
star
star
star
star
star

"Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

@Matt, YC alum
platform
comments
12
likes
108

"Reading used to feel like a chore. Now it’s just part of my lifestyle."

@Erin, Investment Banking Associate , NYC
platform
comments
254
likes
17

"Feels effortless compared to reading. I’ve finished 6 books this month already."

@djmikemoore
platform
star
star
star
star
star

"BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

@Pitiful
platform
comments
96
likes
4.5K

"BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

@SofiaP
platform
star
star
star
star
star

"BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

@Jaded_Falcon
platform
comments
201
thumbsUp
16

"It is great for me to learn something from the book without reading it."

@OojasSalunke
platform
star
star
star
star
star

"The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

@Leo, Law Student, UPenn
platform
comments
37
likes
483

"Makes me feel smarter every time before going to work"

@Cashflowbubu
platform
star
star
star
star
star

"Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

@Moemenn
platform
star
star
star
star
star

"I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

@Chloe, Solo founder, LA
platform
comments
12
likes
117

"Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

@Raaaaaachelw
platform
star
star
star
star
star

"Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

@Matt, YC alum
platform
comments
12
likes
108

"Reading used to feel like a chore. Now it’s just part of my lifestyle."

@Erin, Investment Banking Associate , NYC
platform
comments
254
likes
17

"Feels effortless compared to reading. I’ve finished 6 books this month already."

@djmikemoore
platform
star
star
star
star
star

"BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

@Pitiful
platform
comments
96
likes
4.5K

"BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

@SofiaP
platform
star
star
star
star
star

"BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

@Jaded_Falcon
platform
comments
201
thumbsUp
16

"It is great for me to learn something from the book without reading it."

@OojasSalunke
platform
star
star
star
star
star

"The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

@Leo, Law Student, UPenn
platform
comments
37
likes
483

"Makes me feel smarter every time before going to work"

@Cashflowbubu
platform
star
star
star
star
star

"Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

@Moemenn
platform
star
star
star
star
star

"I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

@Chloe, Solo founder, LA
platform
comments
12
likes
117

"Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

@Raaaaaachelw
platform
star
star
star
star
star

"Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

@Matt, YC alum
platform
comments
12
likes
108

"Reading used to feel like a chore. Now it’s just part of my lifestyle."

@Erin, Investment Banking Associate , NYC
platform
comments
254
likes
17

"Feels effortless compared to reading. I’ve finished 6 books this month already."

@djmikemoore
platform
star
star
star
star
star

"BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

@Pitiful
platform
comments
96
likes
4.5K

"BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

@SofiaP
platform
star
star
star
star
star

"BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

@Jaded_Falcon
platform
comments
201
thumbsUp
16

"It is great for me to learn something from the book without reading it."

@OojasSalunke
platform
star
star
star
star
star

"The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

@Leo, Law Student, UPenn
platform
comments
37
likes
483

"Makes me feel smarter every time before going to work"

@Cashflowbubu
platform
star
star
star
star
star
Start your learning journey, now