Design Truecaller (Crowdsourced Caller ID) - System Design

An unknown number rings your phone and, before you pick up, the screen says “Rajesh Kumar - Reported as spam 240 times.” You have never saved that number. Your phone has never seen it. So where did the name come from? The trick behind Truecaller is deceptively simple to state and genuinely hard to build: millions of other people have that number saved in their address book under some name, and Truecaller has quietly aggregated all of those private address books into one giant global reverse phone directory. You uploaded your contacts once; so did 350M other people; the union of everyone’s contacts is the product. ...

29 min

NSC vs KVP vs Post Office Time Deposit: Which Wins After Tax for a 30 Percent Bracket Investor

Here is the line that gets repeated at every post office counter: “KVP doubles your money, NSC gives you tax benefit, TD gives you flexibility - pick what suits you.” It sounds balanced. It is wrong for one specific person, and that person is you if you sit in the 30 percent tax bracket. For you, the headline rate barely matters. What matters is a single boring clause in Section 80C, and it separates these three instruments by roughly 1.6 percentage points of post-tax return every year, which is a chasm at these rates. ...

10 min

Tool-Calling Patterns That Actually Work in Production AI Agents

Most agent tutorials show the same thing: define one tool, let the model call it once, print the result, declare victory. That is not an agent. That is a function call with extra steps. The moment you put it in front of real traffic, the model calls three tools when it should have called one, invents a parameter that does not exist, retries a failed payment four times, and hangs for ninety seconds because a downstream API timed out and nobody told the model. ...

11 min

CI/CD for AI Applications Is Different - What Changes When Your Logic Lives in a Prompt

A git commit does not capture what your AI application actually does. You can freeze every line of Python, tag the release, and deploy the exact same container to two regions - and get materially different behavior because one region is pinned to a model snapshot that got deprecated and silently rerouted, and the other is reading a retrieval index that was rebuilt yesterday. Your test suite passed. Your code did not change. Your product got worse anyway. ...

12 min

Design a CDN (Content Delivery Network) - System Design

A CDN sounds like a caching proxy you already know how to build: put an Nginx in front of the origin, set a TTL, done. That intuition survives about one slide. A real CDN is a globally distributed system whose entire job is to put a copy of someone else’s bytes physically close to every human on earth, keep those copies fresh (or provably safe to serve stale), route each request to the right box in the right city without the client knowing any of the plumbing exists, and do all of this while sustaining billions of requests per second and ~100 Tbps of egress without ever letting the origins behind it feel the load. The interesting part is not “cache a file.” It is: thousands of points of presence spread across the planet, each independently caching, each pulling from a shared origin through a tiered hierarchy that collapses cache-fill traffic, all fronted by a routing layer that steers a viewer in Lagos to a box in Lagos, plus an invalidation system that can purge a stale object from every edge on earth in seconds. Let me build it properly. ...

33 min

Design a DNS Resolver System - System Design

A DNS resolver sounds like a lookup table: a client asks “what is the IP for example.com,” you return an A record, done. That intuition survives about one query. A real recursive resolver is a globally distributed system whose whole job is to turn a name into an address by walking a delegation tree of servers it does not own, cache the answer for exactly as long as the record’s TTL allows and not one second more, hand back the geographically right address so a user in Mumbai gets the Mumbai edge of the site they asked for, and do all of this in under 50ms at p99 while sustaining trillions of queries per day. The interesting part is not “look up a name.” It is: thousands of resolver nodes spread across the planet behind one anycast IP, each running a recursive engine that chases NS delegations from the root down while a multi-tier cache absorbs 90%+ of traffic, each honoring per-record TTLs so answers are fresh without hammering authoritative servers, and each returning ECS-aware answers so the address you get is close to you - all while a single slow or dead authoritative server upstream must never stall the box. Let me build it properly. ...

32 min

Design Jira (Bug / Issue Tracking) - System Design

Jira looks like a CRUD app with extra menus. Create a ticket, assign it, drag it across a board, close it. Say that in an interview and the hard parts arrive in the first follow-up. “Every org defines its own fields - one team has a Story Points number, another has a Severity dropdown and a Customer picker - and users search across all of them with JQL like project = PAY AND status IN (Open, Reopened) AND assignee = currentUser() AND "Story Points" > 5 ORDER BY priority DESC.” “A ticket cannot jump from Open straight to Closed if the workflow says it must pass through In Review first, and the transition may run validators and fire a post-function.” “There are 100K organizations and 1B tickets total, most orgs tiny and a few enormous, and complex queries are the common case, not the exception.” ...

28 min

NPS Is Not as Illiquid as You Think: The 25 Percent Partial Withdrawal Rule

The single most common objection to NPS is one word: illiquid. “Your money is locked till 60.” That line kills the product for most people before they read a single rule. It is also mostly wrong, and the people repeating it have usually never opened the withdrawal section of the PFRDA rulebook. Here is what almost nobody tells you: after just three years in NPS, you can pull out up to 25% of your own contributions, tax-free, for a specific list of life events - a child’s education, a child’s marriage, buying or building a house, or treating a serious illness. Three years. Not sixty. That is faster access than PPF, which makes you wait until the seventh year. ...

9 min

Design Coursera / Online Learning Platform - System Design

An online learning platform looks like “YouTube with a login” for about a minute, and then the differences bite. Video is only one plane of it: the actual product is a learner working through a structured course - watching a lecture, then taking a quiz that gets graded instantly, then submitting a programming assignment that runs against a test harness, then having every one of those actions bump a progress record that decides whether they have earned a certificate. The video is stateless and cacheable; everything wrapped around it is stateful, per-learner, write-heavy, and correctness-sensitive in a way a video counter never is. A wrong view count is a rounding error nobody notices. A wrong grade or a certificate issued to someone who did not finish is a support ticket and a trust problem. ...

31 min

Design Multiplayer Game Matchmaking - System Design

Everyone thinks matchmaking is “put waiting players in a list, grab the first ten, start a game.” That works in a hackathon demo with fifty players. Then the interviewer piles on the real constraints: the ten players you grabbed have to be close in skill or the match is a stomp and everyone rage-quits; they have to be in the same region or the connection lags to death; the ping between them has to be low even within a region; nobody should wait more than about thirty seconds staring at a “finding match” spinner; and the two teams you form out of those ten have to be balanced against each other, not just individually skilled. And you are doing this for 10 million people queued at the same time, continuously. ...

28 min

Design Online Auction (eBay) - System Design

An online auction looks like “a listing with a current price that goes up,” and if you model it that way you will lose the interview in the first five minutes. The trap is that an auction is not a CRUD row you update - it is a serialization problem wearing a shopping-site costume. The moment two people bid on the same item at the same instant, you have a race: which bid is higher, which one wins, what is the new current price, and did the loser get told they were outbid. Multiply that by a “hot” item - a rare sneaker drop, a graded Charizard, a concert ticket - where thousands of people pile in during the last ten seconds, and the naive “read price, compare, write price” pattern shreds itself into lost updates and double-wins. Then remember there are 100M active listings and each one has a hard deadline, and every one of those deadlines must fire close to on time, or the auction that “ended at 9:00:00” is still taking bids at 9:00:04 and someone is furious. ...

31 min

Sovereign Gold Bond: The Tax Math of Selling Early Versus Waiting 8 Years

Most people think the SGB lock-in is the problem: eight years with your money stuck. That framing is backwards. The eight-year clock is not a cage, it is a coupon. The last three years of an SGB’s life are the only years in Indian gold where your entire capital gain is legally tax-free. Sell on the NSE in year five and you do not just exit early, you hand back the single best tax break the government still offers a retail investor. This post puts a rupee number on exactly what that costs. ...

9 min

Technical Debt Is a Business Problem - How to Get Your Manager to Care About Refactoring

Your manager does not care that the payment module is “a mess.” They have heard that sentence about six different modules from four different engineers this quarter, and every one of them wanted two weeks to rewrite something that currently works. From where they sit, “this code is bad” is indistinguishable from “I do not enjoy working in this file.” I have watched good refactoring proposals die in this exact spot. The engineer was right about the code and still lost the argument, because they argued in a language the person holding the budget does not speak. The fix is not a better slide deck. The fix is translation. Technical debt is not a code quality problem you need leadership to understand. It is a business cost you need to measure and put in front of them in their own units. ...

10 min

Design Coinbase (Crypto Exchange) - System Design

“Let users buy and sell crypto” hides two different, both-irreversible problems welded together. Inside the exchange, Coinbase is a matching engine: for a popular pair like BTC-USD it holds its own order book, matches your buy against someone’s sell by price-time priority, and the moment two orders cross, a trade has happened and cannot be un-happened. Outside the exchange, Coinbase is a custodian on a blockchain: it holds your coins, watches public chains for your deposits, and signs withdrawals that broadcast to Bitcoin or Ethereum where a confirmed transaction is permanent - no chargeback, no reversal, no support ticket that claws it back. So the core invariant is brutal on both sides: never let a user trade or withdraw a balance they do not have, never double-credit a deposit or double-broadcast a withdrawal, and never let the internal ledger disagree with what is actually on-chain. ...

35 min

Design Robinhood (Stock Trading Platform) - System Design

“Let a user buy and sell stocks” sounds like a form that writes a row. Then you notice where the money and the shares actually live. Robinhood does not match your buy against someone’s sell - an exchange does that. Robinhood is the broker: the stateful intermediary that holds your cash and your positions, reserves your buying power the instant you place an order, forwards that order to a real exchange or market maker, tracks it through a lifecycle it does not fully control, and settles the fill back into your portfolio - all while showing you a portfolio value that moves with the market in real time. A fill at the exchange is irreversible. You cannot un-buy 100 shares of AAPL. So the broker’s core invariant is brutal: never let a user place an order they cannot cover, never lose or duplicate an order sent to the exchange, and never let the positions ledger disagree with reality. ...

32 min

Design Venmo / P2P Payment - System Design

Venmo looks like a wallet with a Twitter feed bolted on, and that framing is exactly what makes it interesting. The money side demands strong consistency and an immutable ledger - a balance that goes negative from a race is theft, a double-send is a refund and an angry user. The social side demands fan-out, ranking, and privacy - a feed of “Alice paid Bob for dinner” that must respect who is allowed to see what, at read rates 100x the write rate. And sitting across both is fraud: an account takeover draining a balance, a scammer collecting payments for goods that never ship, a stolen card funding a top-up that gets clawed back. Get the ledger right but the fraud wrong and you lose real money; get fraud right but the feed wrong and you leak who paid whom. ...

32 min

NRI Investing in India - The NRE and NRO Account Confusion Finally Explained

Most NRIs I have talked to hold both an NRE and an NRO account, and almost none of them can tell you which money is supposed to go where. They opened both because the bank relationship manager told them to, and now they route salary transfers into whichever account the app opens first. That works right up until the day they want to move money back out of India, sell a mutual fund, or file a US tax return. Then the accounts stop being interchangeable and the difference costs real money. ...

10 min

TDS on FD: Does Splitting Across Banks Actually Beat Submitting Form 15G

Here is the uncomfortable truth almost every “how to avoid TDS on FD” article skips: for a taxpayer, avoiding TDS saves exactly zero rupees of tax. TDS is not a tax. It is a withholding, an advance instalment of a bill you owe anyway. Splitting a Rs 30 lakh corpus across five banks to keep each one under the threshold is a lot of running around to defer nothing. And yet the “split your FDs across banks” advice gets repeated every year like a life hack. Let me actually model it. Take a Rs 30 lakh FD corpus at 7%, throwing off Rs 2,10,000 of interest a year, and run three strategies side by side: ...

11 min

Design GitHub (Code Hosting + PRs) - System Design

“Host code and let people review changes” sounds like a CRUD app with a diff view. It is not. Under the hood you are running a fleet that stores 100M Git repositories, each a content-addressed object database with its own history, serving the Git wire protocol (which is a chatty, stateful negotiation, not a REST call), computing diffs and merges on demand, fanning out webhooks to CI on every push, and - the genuinely hard part - indexing and searching across all public source code on earth so a query for a function name returns in a few hundred milliseconds. Every one of those is a different system with a different bottleneck. ...

36 min

Design LinkedIn (Professional Graph + Feed) - System Design

LinkedIn looks like Twitter with a suit on. It has a feed, it has profiles, people follow each other. So candidates walk in ready to reuse the Twitter fan-out answer and get about four minutes in before the interviewer asks the question that breaks it: “This person is a 2nd-degree connection. How did you compute that?” Now you are not designing a feed. You are designing a graph query engine that answers “are these two of my billion users within three hops of each other” in under 100ms, on a graph with 500 billion edges. ...

24 min