Blogs


How Youtube Works?

There is a moment every engineer has when they first truly think about what YouTube does. Not the product, but the machine. Someone in rural Indonesia uploads a phone video of a street cat doing something peculiar. Within minutes, that video is available in crisp 1080p to a user in São Paulo, another in Stockholm, and a third on a slow connection in rural Kenya who gets a smooth 360p stream without a single rebuffering event. The recommendation engine is already deciding who else should see it. The ad system has already matched it to relevant advertisers. The copyright scanner has already checked it against a database of millions of audio and video fingerprints.

Alt text

That is not magic. That is engineering, done at a scale that very few systems in the world have ever had to achieve.

YouTube serves over 2 billion logged-in users every month. More than 500 hours of video are uploaded to the platform every single minute. The platform delivers over a billion hours of video playback per day. When you build a system at that scale, you cannot afford to think about problems the way you would in a startup. Every architectural decision has second and third order consequences. A naive caching strategy does not just waste a few dollars — it can collapse under load during a major event. A poorly designed upload pipeline does not just frustrate one creator — it fails millions simultaneously.

Read on →

How Airbnb Works?

Every time you search for a place to stay in Tokyo, lock in a booking for next weekend in Lisbon, or message a host about parking — you’re touching a system that handles millions of concurrent users, real-time availability across 7 million listings, payment transactions in dozens of currencies, and geo-spatial searches across the entire planet. Let’s pull back the curtain.

Alt text

Airbnb is one of the most fascinating systems to think about from an engineering standpoint. Not because any single piece is extraordinarily novel on its own, but because the combination of problems they have to solve simultaneously is genuinely hard.

You have geo-spatial search that needs to return results in under 200ms. You have a booking system that must never double-book a property, even when two guests are clicking “Reserve” at the exact same millisecond. You have dynamic pricing that shifts based on local events, season, and demand signals. You have payments flowing across 220+ countries with fraud detection running on every transaction. And you have to do all of this reliably for a platform where a single outage during peak travel season means real money lost for real hosts around the world.

As of recent years, Airbnb has over 7 million active listings in 220+ countries, serves hundreds of millions of guest arrivals per year, and sees traffic spikes that correlate with holiday seasons, major events, and even viral social media moments. That’s the scale we’re designing for.

Read on →

How Reddit Works?

If you’ve ever refreshed your Reddit feed at midnight, upvoted a post, or gone down a rabbit hole in a subreddit — you’ve touched a system that serves hundreds of millions of users every day. But have you ever wondered what’s actually happening under the hood? Let’s find out.

Alt text

Reddit calls itself “the front page of the internet,” and honestly, that’s not far off. At its core, Reddit is a massive, community-driven link aggregator and discussion platform — think of it as a giant bulletin board broken into thousands of topic-specific rooms called subreddits.

As of 2024, Reddit had:

  • ~1.5 billion monthly active users visiting the site
  • ~100,000 active subreddits
  • Over ~500 million posts and billions of comments
  • Multiple millions of concurrent users at peak times

What makes Reddit an interesting system design problem is the combination of scale, real-time interaction, and community-specific complexity. You have users browsing feeds, posting content, voting, commenting in real-time, getting notifications, and all of this happening across extremely diverse communities with completely different moderation rules.

It’s not as real-time as Twitter (where every tweet needs instant fan-out). It’s not as media-heavy as YouTube. But it’s arguably more complex than both because it combines a social graph, content ranking, tree-structured comments, moderation tools, and real-time interactions all in one platform.

Let’s break it all down.

Read on →

How WhatsApp Works?

The Insane Scale of WhatsApp

Let’s start with numbers, because they’re genuinely mind-blowing. WhatsApp isn’t just a chat app — it’s one of the largest distributed systems ever built by humans.

Alt text

Metric Number
Monthly Active Users 2 billion+
Messages sent per day 100 billion
Peak messages per second 1 million+
Photos shared daily 60 billion

And here’s the kicker — in 2012, when WhatsApp hit 27 billion messages per day, they had only 32 engineers. That’s the kind of engineering efficiency that makes the rest of the tech world jealous.

Read on →

A Desert Bean and an Oil Revolution

How a nation that once begged OPEC for oil became the world’s largest producer, with a little help from Rajasthan’s desert farmers

Alt text

The Smell of Dependence

Picture this. It is October 1973. Richard Nixon is in the White House. The Vietnam War is winding down. And in the Middle East, a coalition of Arab nations has just made a decision that will bring the most powerful economy on Earth to its knees.

In retaliation for American support of Israel during the Yom Kippur War, the Arab members of OPEC, led by Saudi Arabia, announced an oil embargo against the United States. Overnight, the taps were turned off. Oil prices quadrupled from $3 to $12 a barrel. Petrol stations ran dry. Americans queued for hours, sometimes all night, just to fill their tanks. The speed limit on highways was slashed to 55 mph to conserve fuel. The lights on the Christmas tree at Rockefeller Center were dimmed. The world’s richest country was brought to a standstill by a commodity it did not control.

Read on →