Big data at Indian scale: UPI, IRCTC, live cricket and sale days

UPI moves around 80 crore payments a day, IRCTC has sold over 37,000 tickets in a single minute, and 5.9 crore people once watched the same cricket final at the same moment. In this lesson you turn those headline numbers into requests per second, follow one UPI payment through the network, watch a waiting room tame the Tatkal rush, see why a retry must never debit twice, and learn how live streams reach crores of phones.

Module 4 · The Ecosystem⏱ 30 minBeginner → AdvancedRuns in your browser (Python)3 real-time scenariosLoad estimator for your PC9 practice problems
1 The story

10:00 am in India

It is 9:59 am. Kabir has two browser tabs open: the IRCTC Tatkal page for his mother’s ticket home, and the TiffinGo dashboard, where lunch orders are about to spike. At 10:00 both pages slow down. He books the ticket after a short wait in a queue, pays by UPI in two seconds, and opens the cricket stream on his phone during lunch, where crores of people are watching the same over.

UPI80 crore+payments a dayIRCTC37,410tickets in one minuteLive cricket5.9 crorewatching at onceSale daycroresof product page views India runs some of the largest real-time systems in the world. myphatshala.in
Kabir

Sir, our app struggles with a few thousand lunch orders a minute. How does UPI handle 80 crore payments a day? How does IRCTC survive Tatkal?

Arjun Sir

They use the same ideas you’ve learnt in this course, at a bigger size: partitioning, replication, queues, caches, streams and lakes. Today we’ll open up four Indian systems and see which ideas carry the weight.

Riya

Do we know exactly how they’re built inside?

Arjun Sir

Good question, Riya. Only partly. NPCI, IRCTC and the streaming and e-commerce companies publish some numbers and talks, but not their full designs. So we’ll be careful: published figures are marked with sources, and the rest is the standard pattern any engineer would use for that problem.

Kabir

So I can learn to design for crores of users by studying these four?

Arjun Sir

Yes. And you’ll do the arithmetic yourself: turning “80 crore a day” into requests per second, peaks and terabytes is the first skill interviewers check.

2 Definition

Big data at Indian scale

Formal definition (write this in exams)

Large-scale systems serve very high numbers of users and transactions with strict requirements on throughput, latency, availability and correctness. Designing them involves estimating load (average and peak requests per second, data volume), and applying distributed-systems techniques: horizontal scaling, partitioning, replication, caching, content delivery networks, asynchronous messaging, rate limiting and load shedding, together with streaming and batch data platforms that capture every event for monitoring, fraud detection, analytics and audit.

In simple words

A system is at India scale when crores of people use it, often at the same moment. To survive, it spreads work over many machines, keeps copies, answers repeated questions from caches, makes people wait in fair queues during rushes, and records every action as data for later analysis.

Words you’ll meet in this lesson

TPS / RPSTransactions or requests per second: the basic unit of load.
Peak-to-average ratioHow many times busier the busiest second is than the average second.
ConcurrencyHow many users or requests are active at the same moment.
CDNContent delivery network: servers near users that cache and deliver content such as video segments.
Waiting roomA queue in front of a system that admits users at a rate the system can handle.
IdempotencyDoing the same request twice has the same effect as doing it once (no double debit).
Hot keyA single key (train, match, product) receiving a disproportionate share of traffic.
Load sheddingDeliberately rejecting or simplifying some work to protect the core under overload.

Published figures used in this lesson

UPI, September 202624.07 billion transactions worth ₹29.37 lakh crore; about 80.2 crore a day on average (August 2026 set the record at 24.51 billion)
IRCTCpeak of 37,410 tickets booked in one minute (16 Aug 2025); record 18.4 lakh tickets in a day (19 Aug 2025); about 89% of reserved tickets booked online
Live streaming5.9 crore peak concurrent viewers on Disney+ Hotstar for the 2023 ICC World Cup final, India vs Australia

Sources are listed at the end of the Real-world use section. Internal designs of these systems are not fully public: the architecture shown here is the standard pattern for each problem, not a confirmed blueprint.

India-scale systems at three levels

Pick your level. New to this? Start at Beginner and climb.

Beginner What “India scale” means

  • Many users at the same moment: Tatkal at 10 am, the last over of a final, midnight sale launches. The problem is the peak, not the daily average.
  • Every request matters: a lost payment or a double-booked berth is a serious failure, so correctness is as important as speed.
  • Huge variety of devices and networks: cheap phones, 2G to 5G, many languages. Systems must be light and tolerant of slow connections.
  • All of it creates data: each payment, booking and video second becomes an event for fraud checks, dashboards, recommendations and reports.

Intermediate The patterns behind each system

  • UPI: a central switch (NPCI) routes requests between payment apps and banks; it is an online transaction system that needs strong consistency for money, with streaming fraud checks beside it.
  • IRCTC: a short, extreme peak; standard answers are waiting rooms, rate limits, caching of read-heavy pages (availability, fares), and a carefully protected seat-allocation core.
  • Live streaming: video is cut into small segments and pushed through CDNs (servers close to viewers), with adaptive bitrate; event data streams into analytics for ads and quality.
  • E-commerce sales: catalogue and search served from caches and search clusters, inventory and orders sharded and protected, clickstream into Kafka and a lakehouse for real-time dashboards and recommendations.

Advanced Design trade-offs at peak

  • Peak-to-average ratio: design capacity for the peak (often several times the average) plus headroom; pre-scale for known events instead of relying only on autoscaling, which may react too slowly.
  • Backpressure and load shedding: admit at a safe rate (queues, tokens), degrade gracefully (turn off recommendations before checkout), and fail fast instead of piling up timeouts.
  • Consistency where it matters: money and seats need strong consistency and idempotency (a retried payment must not debit twice); counters, views and recommendations can be eventually consistent.
  • Hot keys: one train, one match or one product can overload a single partition; caching, request coalescing and splitting hot keys spread the load.
  • Data platform behind it: every event goes to streams (for fraud, live dashboards) and to the lake (for reconciliation, reports, ML), often under data-residency rules.

Exam tip: For a case study, give scale figures (with source and date), convert them to TPS at average and peak, then explain the techniques used: horizontal scaling, partitioning, replication, caching/CDN, queues and rate limiting, and how events flow to a streaming and batch analytics platform.

3 Types and ways to use it

Payments, booking rushes, live streaming and sale days

Payments: UPI

Short, critical transactions between apps and banks via a central switch. Needs strong consistency, idempotency and fraud checks within the payment flow.

Money

Booking rush: IRCTC

Huge spikes at fixed times (Tatkal opens at 10 am for AC classes and 11 am for non-AC). Limited inventory, so fairness and no double-booking matter.

Spikes

Live streaming: cricket

Crores watch the same content at the same moment. Read-only, so CDNs and caching carry the load; the challenge is bandwidth and sudden joins.

Bandwidth

E-commerce sales

Midnight launches with huge browsing, cart and checkout traffic, limited stock of hot deals, and real-time dashboards for the business.

Mixed

Which big data ideas carry each system

SystemMain challengeKey techniquesData platform behind it
UPICorrect money movement at thousands of TPS, high availabilityCentral switch, partitioned and replicated transaction stores, idempotent request IDs, timeouts and reversalsStreaming fraud and risk scoring; daily settlement and reconciliation; regulatory reports
IRCTCA very short, extreme peak on limited seatsWaiting room and rate limiting, cached availability and fares, protected seat-allocation core, captcha and bot controlsBooking and search logs for demand forecasting, fraud (bots, agents) and capacity planning
Live cricketCrores of concurrent viewers joining in minutesSegmented video, adaptive bitrate, multi-CDN, pre-scaling before key moments, graceful degradationPlayback events streamed for quality of experience and ads; concurrency dashboards
Sale dayBrowsing, carts and checkout spike; hot productsCaching catalogue and search, sharded inventory and orders, queues for order processing, feature flags to switch off extrasClickstream into Kafka and a lakehouse; live sales dashboards; recommendations and pricing

Every one of these systems separates the critical path (pay, book, play, order) from everything else (analytics, recommendations, notifications). Under pressure, the extras are queued or switched off so the critical path survives.

4 Step by step

From a headline number to a design

  1. Start from a published number

    per_month = 24.07e9
    per_day = per_month / 30
    print(f"{per_day / 1e7:.1f} crore a day")
    print(f"{per_day / 86_400:,.0f} per second on average")
    80.2 crore a day 9,286 per second on average
    Monthly or daily totals sound huge, but systems are designed in requests per second. 24 billion a month is about 9,300 per second on average.
  2. Estimate the peak

    avg_tps = 9_286
    for ratio in [2, 3, 5]:
        print(f"peak x{ratio}: {avg_tps * ratio:,} TPS")
    peak x2: 18,572 TPS peak x3: 27,858 TPS peak x5: 46,430 TPS
    Traffic is not flat: evenings, salary days, festivals and sale launches are much busier. Designers use a peak-to-average ratio from history and add headroom on top.
  3. Find the critical path

    For UPI: app → switch → payer bank → payee bank → confirmations. For IRCTC: search → availability → seat allocation → payment. Only these steps must succeed in real time.

    Everything else (rewards, notifications, analytics) can be asynchronous through queues, so it never slows the critical path.
  4. Spread and protect the load

    Partition data and traffic (by account, train, region), replicate for failures, cache what is read often, and put a queue or rate limiter in front of anything that can be overwhelmed.

    These are the Module 3 ideas: scale out, shard, replicate, choose consistency per data type.
  5. Size the data platform

    tps, bytes_per_event = 9_286, 1_000
    gb_per_day = tps * 86_400 * bytes_per_event / 1e9
    print(f"{gb_per_day:,.0f} GB of events a day, {gb_per_day * 365 / 1e3:,.0f} TB a year")
    802 GB of events a day, 293 TB a year
    Each transaction creates events for fraud checks, dashboards and audit. Even small events add up to terabytes a year, before replication and logs.
  6. Rehearse the big day

    Load-test at the expected peak plus margin, pre-scale capacity before the event, prepare switches to turn off non-essential features, and watch live dashboards during the event.

    Known peaks (Tatkal, a final, a sale) are planned like launches, with game days and runbooks, not left to chance.
5 See it happen

One UPI payment: what Riya sees, and what happens behind

Step through the six frames. Left: Riya paying a tiffin shop. Right: a simplified view of the request moving through the UPI network.

What Riya sees, and what happens behind 6 steps
What you see Scan & paySharma Tiffins₹ 120Pay ▶Enter UPI PIN● ● ● ●PIN stays on the phone,encryptedProcessingPlease wait…about 1 secondProcessingPlease wait…still under 2 secondsPaid✓₹120 paidRef 6123…DoneShop speaker:“₹120 received”SMS from bank myphatshala.in
Behind the screen PayerappNPCIswitchPayerbankPayeebankThe app builds a request with a unique transaction ID.The ID makes retries safe (idempotency).PayerappNPCIswitchPayerbankPayeebankRequest + encrypted PIN goes to the NPCI UPI switch,which routes by the payer’s bank handle.PayerappNPCIswitchPayerbankPayeebankPayer bank verifies the PIN and balance,debits ₹120 and replies to the switch.PayerappNPCIswitchPayerbankPayeebankSwitch asks the payee bank to credit ₹120.If credit fails, the debit is reversed.PayerappNPCIswitchPayerbankPayeebankConfirmations flow back to both apps.One of ~9,300 payments that second, on average.PayerappNPCIswitchPayerbankPayeebankEvery step was logged as events:fraud scoring, dashboards, settlement, disputes. myphatshala.in
6 Real-world use

Real-time scenarios: rush, retry and live stream

Three live scenarios: the Tatkal waiting room (real numbers from the program below), a payment retry at peak that must not debit twice, and an advanced look at serving crores of live cricket viewers.

Real-time scenario 1

Tatkal at 10 am: a waiting room protects the booking system

These figures come from the program in “Run it on your PC” below: 30,000 users arrive in one minute, but the booking system admits only 250 per second. Watch the queue absorb the spike.

Virtual waiting room 5 steps
Animated example Waiting roomempty250/sBooking system0users admitted9:59:59. The booking system can safely takeabout 250 users a second (illustrative).Waiting room3,750 waiting250/sBooking system3,750users admitted10:00:15. Users arrive far faster than 250/s.Extra arrivals wait in the queue, not on the servers.Waiting room15,000 waiting250/sBooking system15,000users admitted10:01:00. 30,000 users have arrived in one minute.Admitted so far: 15,000; the rest see their place.Waiting room7,500 waiting250/sBooking system22,500users admitted10:01:30. Arrivals have stopped; the queue drainsat a steady 250 per second.Waiting roomempty250/sBooking system30,000users admitted10:02:00. Everyone admitted after 120 s.Median wait 30 s, worst 60 s, servers never overloaded. myphatshala.in
Real-time scenario 2

A retry at peak must not debit twice

At peak, slow links and timeouts are normal. Watch how a unique transaction ID makes a retry safe, which is the core reason payment systems can scale out without losing money.

Idempotent payments 5 steps
Animated example Payer apptxn 7781SwitchPayer bankbalance ₹5,000Salary day evening: traffic is several timesthe average. A ₹500 request leaves the app.Payer apptxn 7781SwitchPayer bankdebited ₹500The bank debits ₹500, but its reply is delayedby a congested network link.Payer apptxn 7781SwitchPayer bankdebited ₹500The app times out and retries withthe SAME transaction ID 7781.Payer apptxn 7781SwitchPayer bankalready doneThe bank sees ID 7781 was already processedand returns the earlier result. No second debit.Payer apptxn 7781SwitchPayer bankbalance ₹4,500Exactly one debit. Idempotency turns“retry” from dangerous into safe. myphatshala.in
Real-time scenario 3 · advanced

Crores join the same match in minutes

Live streaming is the opposite of payments: everyone reads the same data. The hard parts are bandwidth, sudden joins and keeping quality up. Watch the standard design at work.

Live streaming at peak 5 steps
Animated example OriginencoderCDN edge 1CDN edge 2CDN edge 3CDN edge 41.5 crconcurrentviewersMatch starts: video cut into 2–6 s segments,each in several bitrates, cached at CDN edges.OriginencoderCDN edge 1CDN edge 2CDN edge 3CDN edge 4CDN edge 53 crconcurrentviewersPre-scaled for the chase: extra edge capacityand several CDN providers booked in advance.OriginencoderCDN edge 1CDN edge 2CDN edge 3CDN edge 4CDN edge 55.9 crconcurrentviewersLast overs of the 2023 World Cup final:5.9 crore watching at once (published peak).OriginencoderCDN edge 1CDN edge 2CDN edge 3CDN edge 4CDN edge 55.9 crconcurrentviewersEdge 1 is overloaded: viewers are steered to otheredges; players drop to a lower bitrate, not freeze.OriginencoderCDN edge 1CDN edge 2CDN edge 3CDN edge 4CDN edge 55.9 crconcurrentviewersPlayback events stream into analytics:concurrency, buffering, ad delivery, live. myphatshala.in

Four systems, four lessons

UPI

1. UPI: correctness at thousands of TPS

A central switch connects hundreds of banks and many payment apps. Each payment is small but must be exactly-once in effect; streams of events feed fraud checks and settlement.

App→NPCI switch→Banks + settlement

2. IRCTC: survive a fixed-time rush

Tatkal creates a predictable spike on limited seats. Waiting rooms, caching of availability, bot controls and a protected booking core keep it fair; IRCTC has announced upgrades for higher booking rates.

Users at 10 am→Queue + rate limit→Seat allocation

3. Live cricket: bandwidth and sudden joins

Segmented video and multi-CDN delivery serve crores of identical reads. Playback events stream into analytics for quality and ad billing.

Encoder→Multi-CDN edges→Crores of phones

4. Sale days: protect checkout

E-commerce sales (such as Flipkart’s Big Billion Days and Amazon’s Great Indian Festival) cache the catalogue, shard inventory and orders, queue order processing and switch off extras, while clickstream feeds live dashboards.

Browse (cached)→Cart + checkout→Orders queue

Sources for the figures

  • UPI monthly volumes (August and September 2026): NPCI data as reported by StartupTalky, September 2026 and StartupTalky, August 2026.
  • 5.9 crore concurrent viewers, 2023 World Cup final: exchange4media, November 2023.
  • IRCTC peaks (37,410 tickets per minute; 18.4 lakh tickets in a day) and online share: Indian Railways figures as reported by IANS and Free Press Journal (2025–26); planned upgrade to over 1 lakh bookings a minute reported by Outlook Money, August 2026.
  • Figures are as published; check the latest NPCI and IRCTC releases before quoting them.
7 Run the code

Turn headline numbers into engineering numbers

A few published figures are converted into average transactions per second and a design peak. Then try the challenges: peak ratios, event volumes, waiting-room maths, CDN bandwidth and hot keys.

figures = {                          # (count, seconds it covers)
    "UPI, Sep 2026 (month)": (24.07e9, 30 * 86_400),
    "IRCTC record day":      (18.4e5, 86_400),
    "IRCTC peak minute":     (37_410, 60),
}
PEAK_RATIO = 3                       # assumption for daily or monthly averages

for name, (count, seconds) in figures.items():
    tps = count / seconds
    print(f"{name:22}: {tps:8,.0f} per second")
print(f"UPI design peak at x{PEAK_RATIO}: {24.07e9 / (30 * 86_400) * PEAK_RATIO:,.0f} TPS")
UPI, Sep 2026 (month) : 9,286 per second IRCTC record day : 21 per second IRCTC peak minute : 624 per second UPI design peak at x3: 27,859 TPS
  • tps = count / secondsEvery design starts here: divide a total by the seconds it covers.
  • PEAK_RATIO = 3 # assumption for daily or monthly averagesAverages hide peaks. A peak minute is already a peak, so the ratio is applied only to long averages.

Run it on your PC: India-scale load and a Tatkal waiting room

This program converts published UPI, IRCTC and live-streaming figures into per-second load and bandwidth, then simulates a virtual waiting room: 30,000 users arrive in one minute and are admitted at 250 per second. Change the arrival count or admit rate and run it again. Save it as indian_scale.py.

From headlines to TPS, and a waiting room

"""India-scale numbers turned into per-second rates, and a Tatkal-style
virtual waiting room that admits users at a safe rate."""
import random

published = {
    # figure, unit, source (see the lesson's Sources list)
    "UPI, September 2026": (24.07e9, "transactions in the month"),
    "IRCTC, peak minute (16 Aug 2025)": (37_410, "tickets in one minute"),
    "Live cricket, 2023 World Cup final": (5.9e7, "concurrent viewers"),
}

upi_per_s = 24.07e9 / (30 * 86_400)
irctc_per_s = 37_410 / 60
viewers = 5.9e7
bitrate_mbps = 2.5                       # assumption: an average mobile stream
print(f"UPI average           : {upi_per_s:,.0f} transactions per second")
print(f"IRCTC peak            : {irctc_per_s:,.0f} tickets per second")
print(f"Live final, bandwidth : {viewers * bitrate_mbps / 1e6:,.0f} Tbps if every viewer streams {bitrate_mbps} Mbps")

# ---- a virtual waiting room for a 10:00 am rush
random.seed(3)
arrivals = sorted(random.uniform(0, 60) for _ in range(30_000))   # 30,000 users in the first minute
ADMIT_PER_SECOND = 250                                            # what the booking system can safely take
admitted_at = []
next_slot = 0.0
for t in arrivals:
    start = max(t, next_slot)
    admitted_at.append(start)
    next_slot = start + 1 / ADMIT_PER_SECOND
waits = [a - t for a, t in zip(admitted_at, arrivals)]
print(f"\nWaiting room: {len(arrivals):,} users arrive in 60 s, admitted at {ADMIT_PER_SECOND}/s")
print(f"  last user admitted after {admitted_at[-1]:.0f} s")
print(f"  median wait {sorted(waits)[len(waits) // 2]:.0f} s, worst wait {max(waits):.0f} s")
print("  the booking servers never see more than 250 users per second")

# In a terminal:  python indian_scale.py
UPI average : 9,286 transactions per second IRCTC peak : 624 tickets per second Live final, bandwidth : 148 Tbps if every viewer streams 2.5 Mbps Waiting room: 30,000 users arrive in 60 s, admitted at 250/s last user admitted after 120 s median wait 30 s, worst wait 60 s the booking servers never see more than 250 users per second

Recorded from a real run with Python 3.13. The figures are published numbers (see Sources); the 2.5 Mbps bitrate and the 250-per-second admit rate are assumptions for illustration, not IRCTC or Hotstar settings.

8 Line by line

Admitting a rush, one user at a time

Five users arrive almost together; the system admits one every 2 seconds. Watch each user’s admit time and wait being calculated.

Worked examples: real problems, solved and traced in memory

Four estimation and design calculations from India-scale systems. Each runs live and is traced.

Example 1BeginnerEstimation · TPS

Per-second load from a daily figure

Problem statement

IRCTC’s record day was 18.4 lakh tickets. Find the average tickets per second, and compare it with the record minute of 37,410 tickets.

Input
18.4 lakh per day · 37,410 per minute
Expected output
average 21/s, peak 624/s, ratio 29x

Approach

  1. Average per second = daily total ÷ 86,400.
  2. Peak per second = peak minute ÷ 60.
  3. Ratio = peak ÷ average.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 2IntermediateCapacity · servers

How many servers for the UPI peak?

Problem statement

Average UPI load is about 9,300 TPS. Design for 4× peak and keep 30% headroom. Each application server safely handles 800 TPS. How many servers, and how many with one full data centre out (two equal sites)?

Input
9,300 TPS, 4× peak, 30% headroom, 800 TPS/server, 2 sites
Expected output
design load 48,360 TPS -> 61 servers
survive one site down -> 61 per site, 122 in total

Approach

  1. Design load = average × peak ratio × (1 + headroom).
  2. Servers = load ÷ per-server capacity, rounded up.
  3. If one of two sites can fail, each site must carry the full load.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 3IntermediatePayments · idempotency

Count the double debits that idempotency prevents

Problem statement

A log of payment requests includes retries with the same transaction ID. Count the unique payments, the retries, and the amount that would have been wrongly debited without idempotency.

Input
(txn_id, amount) pairs
Expected output
3 payments, 3 retries, Rs 1120 not double-debited

Approach

  1. Track IDs already processed in a set.
  2. A repeated ID is a retry: count it and its amount.
  3. Unique IDs are the real payments.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 4AdvancedLive streaming · capacity

Plan CDN capacity for a final

Problem statement

Expect 6 crore concurrent viewers. Viewers watch at 0.8, 1.5, 2.5 or 4 Mbps in shares 20%, 35%, 35%, 10%. Each CDN provider can deliver up to 60 Tbps for this event. How many providers are needed with 25% spare, and what share of viewers is lost if one provider fails?

Input
6 crore viewers, bitrate mix, 60 Tbps per CDN, 25% spare
Expected output
avg 1.96 Mbps, peak 118 Tbps, CDNs needed 3
one CDN down: 120 Tbps, covers 100% at full quality

Approach

  1. Average bitrate = Σ share × bitrate.
  2. Peak Tbps = viewers × average bitrate.
  3. Providers = ceil(peak × 1.25 ÷ 60); a failure removes 60 Tbps.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

9 Quiz and revision

Check yourself

Quick revision

Lesson 4.7 in one screen

  • Design in per-second units: total ÷ seconds. UPI ≈ 24 billion/month ≈ 9,300 TPS average (Sep 2026).
  • Plan for the peak (peak-to-average ratio) plus headroom; pre-scale for known events.
  • Separate the critical path (pay, book, play, order) from extras; queue or switch off extras under load.
  • Waiting rooms and rate limits turn overload into fair waits.
  • Payments: strong consistency, idempotency keys, reversals and daily reconciliation.
  • Live streaming: segments + adaptive bitrate + multi-CDN; 5.9 crore concurrent peak (2023 final).
  • Hot keys break even partitioning; every event also feeds streams and the lake for fraud, dashboards and audit.

Interview and viva questions

How does UPI handle so many transactions?

UPI connects payment apps and banks through NPCI’s central switch, which routes each request to the right banks. Scale comes from horizontally scaled, replicated systems at NPCI and at banks, short and well-defined messages, unique transaction IDs that make retries safe, timeouts with reversal flows, and daily settlement and reconciliation. Detailed internal designs are not fully public.

Why does the IRCTC site slow down at Tatkal time?

Tatkal booking opens at fixed times (10 am for AC classes, 11 am for non-AC), so a very large number of users arrive within seconds for limited seats. The peak is many times the daily average. Systems handle it with queues or waiting rooms, rate limits, caching of availability and fares, bot controls and capacity upgrades; IRCTC has announced plans to handle over one lakh bookings a minute.

How do streaming apps handle crores of concurrent viewers?

Video is encoded into short segments at multiple bitrates and delivered through content delivery networks with servers close to viewers, often several CDNs at once. Capacity is reserved before big events, players adapt quality to network conditions, and non-essential features can be switched off. Player events stream into analytics for quality monitoring and ad delivery.

What is idempotency and why is it important in payments?

An operation is idempotent if doing it more than once has the same effect as doing it once. In payments, each request carries a unique ID; if a timeout causes a retry, the server recognises the ID and returns the original result rather than debiting again. It makes retries, which are unavoidable in distributed systems, safe.

How do you estimate load in a system design interview?

Start from users or a published total, convert to per-second averages (divide by 86,400 for a day), apply a peak-to-average ratio from experience or history, add headroom, and estimate data size per request and per day. State every assumption clearly and round sensibly; interviewers care more about the reasoning than exact numbers.

Practice problems

Estimation and design problems based on Indian systems. The last two are business tasks.

P1Easy

Daily to per second

A system handles 50 crore requests a day. Print the average requests per second.

Input
50 crore/day
Expected output
5787
Show solution and explanation
print(round(50e7 / 86_400))
5787

How it works: Divide by 86,400 seconds in a day.

P2Easy

Peak minute to per second

37,410 tickets were booked in one minute. Print tickets per second.

Input
37,410/min
Expected output
624
Show solution and explanation
print(round(37_410 / 60))
624

How it works: A peak minute already reflects peak load; just divide by 60.

P3Easy

Crore to number

Print 5.9 crore as a plain number with commas.

Input
5.9 crore
Expected output
59,000,000
Show solution and explanation
print(f"{int(5.9e7):,}")
59,000,000

How it works: 1 crore = 10 million, so 5.9 crore = 59 million.

P4Medium

Design peak

Average is 12,000 TPS. Design for 4× peak with 25% headroom. Print the design TPS.

Input
12,000, 4×, 25%
Expected output
60000
Show solution and explanation
print(int(12_000 * 4 * 1.25))
60000

How it works: Peak ratio first, then headroom on top.

P5Medium

Queue clear time

45,000 users arrive in 60 s; 300 are admitted per second. Print when the queue empties.

Input
45,000, 60 s, 300/s
Expected output
150.0 seconds
Show solution and explanation
print(max(60, 45_000 / 300), "seconds")
150.0 seconds

How it works: The queue cannot clear before the last arrival, nor faster than the admit rate allows.

P6Advanced

Event storage

9,300 TPS, 8 events per transaction, 1.2 KB each, 3 replicas. Print TB per day.

Input
as given
Expected output
23.1 TB/day
Show solution and explanation
print(round(9_300 * 86_400 * 8 * 1.2e3 * 3 / 1e12, 1), "TB/day")
23.1 TB/day

How it works: Rate × seconds × events × size × copies.

P7Advanced

Remove duplicate retries

Given IDs ["t1","t2","t1","t3","t2"], print the unique IDs in first-seen order.

Input
list of IDs
Expected output
['t1', 't2', 't3']
Show solution and explanation
ids = ["t1", "t2", "t1", "t3", "t2"]
print(list(dict.fromkeys(ids)))
['t1', 't2', 't3']

How it works: dict.fromkeys keeps first occurrences in order; this is deduplication by ID.

P8Business problem

Sale-day capacity

Last year’s sale peaked at 1.8 lakh orders per minute. Growth is 35%. Plan with 30% headroom. Print orders per second to design for.

Input
1.8 lakh/min, +35%, +30%
Expected output
5265
Show solution and explanation
print(round(1.8e5 * 1.35 * 1.3 / 60))
5265

How it works: Grow last year’s peak, add headroom, convert to per second.

P9Business problem

Cost of downtime

A platform processes Rs 29.37 lakh crore a month. Print the average value flowing per minute in crore.

Input
Rs 29.37 lakh crore/month
Expected output
Rs 68 crore per minute
Show solution and explanation
per_min = 29.37e12 / (30 * 24 * 60)
print(f"Rs {per_min / 1e7:,.0f} crore per minute")
Rs 68 crore per minute

How it works: This is why payment systems invest heavily in availability.

Real-world scenario questions (asked in company interviews)

Questions about India-scale systems from interviews and real projects. Decide your answer first, then open the model answer.

System design · estimationFresher

“Estimate the load on UPI”

An interviewer says: UPI handles about 24 billion transactions a month. Estimate average and peak TPS and daily event data.

The interviewer is checking: can you turn a headline number into engineering numbers, stating assumptions?

Show a strong answer
  1. Per day: 24 billion ÷ 30 ≈ 80 crore.
  2. Average TPS: 80 crore ÷ 86,400 ≈ 9,300.
  3. Peak: assume 3–5× average at busy hours and festivals → roughly 30,000–45,000 TPS to design for, plus headroom.
  4. Events: if each transaction produces ~10 events of ~1 KB across systems, that is ~8 TB a day before replication.
  5. State assumptions clearly and say how you would validate them (published peak figures, traffic history).

Avoid: giving one number with no assumptions, or designing only for the average.

System design · peaks1–3 years

Design for Tatkal-style rush hour

Your company runs a ticket sale that opens at a fixed time; last year the site crashed in the first minute.

The interviewer is checking: do you know how to protect a system from a predictable spike?

Show a strong answer
  • Estimate peak arrivals from last year and load-test above that.
  • Put a virtual waiting room and rate limits in front of the booking flow.
  • Cache read-heavy pages (availability, fares) and serve static content from a CDN.
  • Pre-scale capacity before opening time; don’t rely only on autoscaling.
  • Protect inventory with strong consistency and short seat holds; stop bots with captcha and limits.
  • Prepare switches to turn off non-essential features; watch live dashboards.

Avoid: just adding more servers to the database.

Payments · correctness1–3 years

A customer was charged twice

During a peak, a few customers were debited twice for one order after network timeouts.

The interviewer is checking: do you understand idempotency and reconciliation?

Show a strong answer

Retries after a timeout re-sent the payment as a new request. Fix: generate an idempotency key (unique transaction ID) on the client, send it with every retry, and store processed keys on the server so a repeat returns the original result. Add a status-check call before retrying, automatic reversal for failed flows, and a daily reconciliation job comparing your records with the bank or gateway settlement files to catch and refund mismatches.

Avoid: removing retries entirely, which turns network blips into failed payments.

Case study · interviewFresher

“How does Hotstar handle crores of live viewers?”

A common case-study question for data and platform roles.

The interviewer is checking: can you explain the standard pattern honestly, without claiming insider knowledge?

Show a strong answer

Explain that internal details are only partly public, then describe the standard design: video encoded into short segments at multiple bitrates (adaptive streaming), cached and delivered by multiple CDNs close to viewers, origin protected by caching, capacity pre-provisioned before big matches, graceful degradation (lower bitrate, switch off extras) and player events streamed into analytics for concurrency, quality and ad billing. Quote a published figure with source, such as the 5.9 crore concurrent peak in the 2023 World Cup final.

Avoid: inventing exact server counts or claiming to know their internal architecture.