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

Design Tinder (Dating + Matching) - System Design

“Design Tinder” sounds like Instagram with a nicer gesture. Show a photo, swipe left or right, if two people both swipe right they can chat. The interviewer lets that toy version sit for about a minute, then drops the number that breaks it: 2 billion swipes a day. That is roughly 23,000 writes per second on average and 70,000+ at peak, every single one of them a tiny row that says “user A has an opinion about user B,” and every one of them potentially the second half of a mutual match that has to fire a notification within a second. ...

28 min

Joint Home Loan with Spouse: You Are Missing Rs 3.5 Lakh of Annual Deductions

Most couples put the home loan in one name. Usually the husband’s, sometimes “whoever the bank suggested,” almost always “to keep it simple.” That single decision quietly throws away up to Rs 3.5 lakh of deductions every year, because home loan tax breaks are granted per person, not per property. Put the loan and the property in both names, and the second spouse gets their own full 80C and their own full Section 24(b), doubling the household’s deductible pool from Rs 3.5 lakh to Rs 7 lakh. ...

12 min

LLM Batch Inference Cuts API Costs in Half - When the Latency Trade-off Is Worth It

Most teams look at the 24-hour SLA on batch APIs and stop reading. That is a mistake. The word “batch” makes people picture overnight mainframe jobs and 1990s ETL, so they never do the arithmetic. Here is the arithmetic: Anthropic and OpenAI both give you a flat 50 percent discount on input and output tokens if you are willing to accept an asynchronous completion window instead of a synchronous response. That is not a routing trick or a caching hack. It is the same model, the same quality, half the bill, in exchange for latency you were probably not using anyway. ...

10 min

80CCD(2) Employer NPS: The Tax Break Beyond 80C Most Salaried People Miss

Almost every salaried person knows the Rs 1.5 lakh under 80C and the extra Rs 50,000 under 80CCD(1B). Far fewer know that there is a third NPS deduction with no upper cap tied to a rupee figure at all - and that it is one of the only real tax deductions still alive in the new tax regime. That deduction is Section 80CCD(2), the employer’s contribution to your NPS. If you are on the new regime (and most people now are, because the 2025 slabs made it the default), your 80C and 80CCD(1B) deductions are gone. 80CCD(2) survives. That makes it the single most valuable deduction a salaried employee can still get, and the majority of people leave it on the table because it needs one thing they never do: a conversation with HR. ...

8 min

Design Reddit (Communities + Voting) - System Design

Reddit reads like three easy problems stapled together. Posts in communities: a table. Voting: a counter. Comments: a tree. Say it out loud and the interviewer starts pulling threads. “A vote must feel instant but the displayed score must not be a live sum of a billion rows.” “The front page is sorted by hot, which is a function of both score and age, so the sort order of every post changes every second even when nobody votes.” “One popular post has 40,000 comments nested twelve levels deep and must paginate.” “A brigade of 5,000 bot accounts can drive a post to the top of a subreddit in ninety seconds, and you have to notice before it happens.” ...

28 min

Design Stack Overflow / Quora (Q&A) - System Design

Stack Overflow looks like a CRUD app. Post a question, others post answers, everyone votes, one answer gets accepted, and a number next to your name goes up. Say that in an interview and the follow-ups arrive fast. “The question page is read a thousand times for every time it is written, and it must show a live-ish score, the accepted answer pinned first, and the rest sorted by score - all in under 200ms.” “Reputation is a running total over every vote you have ever received; you cannot re-sum a billion vote rows on every profile load.” “Search is not a LIKE '%...%' query - a user typing python list comprehension slow must get the canonical answer ranked above ten thousand near-duplicates, and that ranking blends text relevance with votes, recency, and acceptance.” “There are 100M questions and 1B answers; that does not fit on one box.” ...

29 min

Design Zoom (Video Conferencing) - System Design

People hear “build Zoom” and reach for the WebRTC tutorial: two peers, an SDP exchange, media flows directly, done. That works for a 1:1 call and detonates the moment a third person joins, and it is not even in the same universe as a 1000-person all-hands. The core problem in video conferencing is not “how do two browsers connect” - that is solved by WebRTC and I have written about it elsewhere. The core problem is fan-out of live media in a room of N participants under a hard sub-200ms latency budget, and the topology you pick to solve it - mesh, MCU, or SFU - determines whether the product exists at all. ...

29 min

State Machines Make AI Agents Predictable - Why Most Agent Designs Skip Them

Here is a claim that will annoy most people building agents right now: your agent does not have a bug, it has a state problem. The infinite loop, the duplicate refund, the “I already did that” confusion, the run that cannot be resumed after a crash - none of these are model failures. They are what happens when the only record of what an agent has done lives inside a growing pile of chat messages that nobody can query, restart from, or reason about. ...

10 min

Design Amazon Shopping Cart - System Design

A shopping cart sounds like a toy problem. “Store a list of item IDs and quantities for a user, let them add and remove, show it back.” You could do it with a row per user and a JSON blob and be done in an afternoon. Then the interviewer starts adding constraints and every easy answer falls over. The cart has to follow the user from their phone to their laptop to the Alexa in the kitchen, and show the same items on all three within a second. It has to survive the user closing the tab and coming back a week later. It has to stay writable during a Prime Day sale when a hundred million people are hammering “add to cart” on the same few thousand doorbusters at the same instant. And - the hard one - the cart cannot lie about inventory: if the warehouse has 100 units of a limited item, you must not let 500 people put it in their cart, walk to checkout, and each expect it to be there. ...

26 min

Design Migrate 1PB of Data to Cloud - System Design

“Move 1PB to the cloud” sounds like a copy job, and people design it like one: point a script at the source, rsync to an S3 bucket, wait. Then the interviewer drops the two numbers that change everything. The link is 10 Gbps. The files are in active use during the migration. Now do the arithmetic: at 10 Gbps, wire-speed and perfect, 1PB takes about 9.5 days of continuous transfer. Real throughput after overhead and contention with production traffic is half that, so ~20 days. And for those 20 days the source data keeps changing underneath you, so whatever you copied on day one is already stale by day two. ...

25 min

Design Slack (Team Messaging) - System Design

People hear “build Slack” and reach for a chat toy: a messages table, a WebSocket, insert on send, push to whoever is connected. That works for a demo and falls apart the instant you write down the real numbers. The largest org has 100K members. A single busy channel in that org - #general, #incidents, #announcements - can have tens of thousands of people watching it live. When someone posts, who do you deliver to, and how? Do you write a copy of that message into 50,000 inboxes (fan-out on write) and drown on a viral post, or do you store it once and make every reader come find it (fan-out on read) and drown on the read side instead? That single question - how a message gets from one sender to N readers - is the spine of the whole design, and Slack’s answer is different from Twitter’s or Facebook’s because Slack’s unit of delivery is the channel, not the follower graph. ...

28 min

Embedding Model Upgrades Silently Break Production RAG - Here Is How to Handle Them

A new embedding model drops, the benchmarks look great, and someone on your team changes one line of config to point at it. Nothing crashes. The pipeline runs. Queries return results. Latency is fine. Two weeks later, support tickets pile up about the assistant “getting dumber,” and nobody can find a deploy that explains it. This is the most common self-inflicted RAG outage I have seen, and it is entirely invisible to normal monitoring. Swapping embedding models does not throw an error. It quietly corrupts the geometry your retrieval depends on, and the only symptom is answers that are subtly, then badly, wrong. ...

11 min