Add an index vs full table scan
When to add a database index and when a full table scan is the better plan, the numbers that decide, and what each choice costs on reads and writes.
SDE-1SDE-2
Trade-offs
What each option gives you, what it costs, what breaks if you are wrong, and when the answer changes. Free to read. No account needed.
Level tags suggest where a guide is most useful. They do not set your AI mock level.
SDE-1 and SDE-2
The choices every design round touches. Know when each side wins.
When to add a database index and when a full table scan is the better plan, the numbers that decide, and what each choice costs on reads and writes.
SDE-1SDE-2
When to process data in scheduled batches and when to process it as a stream in real time, the numbers that decide, and what breaks with each.
SDE-1SDE-2
Which cache write strategy to pick, the write rate and loss numbers that decide it, and what breaks with each one.
SDE-1SDE-2
When a CDN should pull files from your server on demand and when you should push them ahead of time, the numbers that decide, and what breaks.
SDE-1SDE-2
When to join tables when a query runs and when to store a precomputed result, the numbers that decide, and what each choice breaks.
SDE-1SDE-2
When to use a signed token (JWT) and when to use a server-side session for login, the numbers that decide, and what breaks with each.
SDE-1SDE-2
Which load balancer layer to use, L4 or L7, with the uneven-load numbers for long connections and the cost of reading requests.
SDE-1SDE-2Senior
Which cache eviction rule to pick, LRU or LFU, with a worked hit-rate example, the cases where each fails, and the size check.
SDE-1SDE-2
When to keep one deployable program and when to split it into services, the numbers that decide, and what breaks with each choice.
SDE-1SDE-2
When to keep each fact in one place and when to copy it on purpose, with the read-to-write numbers that decide it.
SDE-1SDE-2
When to keep files in object storage and when to store them inside the database, the numbers that decide, and what breaks with each.
SDE-1SDE-2
When to page a long list with offset and when with a cursor, with row counts, the shifting-page problem and the index you need.
SDE-1SDE-2
Which way to push live updates to a browser or phone, with request counts, server counts and the delay each method gives.
SDE-1SDE-2Senior
When to push data to the receiver and when to let the receiver pull it, the numbers that decide, and what breaks with each side.
SDE-1SDE-2
Which message system to choose: a queue, publish and subscribe, or a log. The numbers that change the answer and what breaks with each.
SDE-1SDE-2
When to copy a database with replicas and when to split it with shards, the numbers that decide, and what each choice breaks and costs.
SDE-1SDE-2
Which API style to pick for browsers, partners and your own services, with call counts, message sizes and delay worked out.
SDE-1SDE-2Senior
When to retry a failed call and when to fail fast and return an error or a fallback, the numbers that decide, and what breaks with each.
SDE-1SDE-2
When to choose a SQL database and when a NoSQL one, the numbers that change the answer, and what breaks with each.
SDE-1SDE-2
When to keep servers stateless with a shared session store and when sticky sessions are acceptable, with the numbers for each.
SDE-1SDE-2
When a caller should wait for the answer and when it should hand work off, the numbers that decide, and what breaks with each choice.
SDE-1SDE-2
Which rate limiting method to choose: token bucket or sliding window. The numbers that decide, the bursts each one allows, and what breaks.
SDE-1SDE-2
How to choose between letting cache entries expire and deleting them when data changes, with the stale-read numbers.
SDE-1SDE-2
How to choose an ID for rows and objects: a database counter, a UUID or a Snowflake-style ID. The numbers that decide and what breaks.
SDE-1SDE-2
When to buy a bigger machine and when to add more machines, with server counts, failure share and daily cost worked out.
SDE-1SDE-2Senior
SDE-2 and Senior
Where systems fail in real life: consistency, replication, messaging, storage engines.
How to choose between at-least-once delivery with idempotent handlers and a broker's exactly-once features, the numbers behind it, and what breaks.
SDE-2Senior
Which storage engine to choose for a database, a B-tree or an LSM tree, with write amplification, read cost and disk wear worked out.
SDE-2Senior
How to choose between queueing, dropping and degrading when work arrives faster than a service can finish it, with queue sizes worked out.
SDE-2Senior
How to choose the bits per key for a Bloom filter, with the false positive formula worked out and what each wrong answer costs.
SDE-2Senior
Which fix to use when a popular cache entry expires: a lock, early refresh or serving stale data, with load counts and wait times worked out.
SDE-2Senior
How to choose circuit breaker thresholds, window size and open time, with the cost of tripping too early and too late worked out.
SDE-2Senior
Which hashing method to use to map keys to servers when servers join and leave, the numbers that change the answer, and what breaks.
SDE-2Senior
When to split reads from writes with CQRS and when one model is enough, the numbers that change the answer, and what breaks with each.
SDE-2Senior
When to store every change as an event and when to store only the current state, with the numbers for storage, replay and rebuilds.
SDE-2Senior
How to choose between building each follower's feed when a post is made or when the feed is opened, the numbers that decide it, and what breaks.
SDE-2Senior
How to choose hash, range or directory sharding for your shard key, the numbers that change the answer, and what breaks when the data grows.
SDE-2Senior
How to choose between leader-follower, multi-leader and leaderless replication, the numbers that change the answer, and what breaks with each.
SDE-2Senior
How to choose between a plain lock, a lease with a time limit and a fencing token, with lease lengths, failure counts and the fallback.
SDE-2Senior
When to keep a secondary index inside each shard and when to build one global index, with query fan-out, write cost and lag worked out.
SDE-2Senior
When to check a version at write time and when to lock a row first, with the clash rates and row limits that decide the choice.
SDE-2Senior
How to choose between a dual write, a polled outbox table and change data capture when a service must save data and tell others, with numbers.
SDE-2Senior
When to store a ready answer in advance and when to calculate it at read time, the numbers that flip the choice, and what breaks with each.
SDE-2Senior
How to choose between a saga and two-phase commit for a job that spans several databases or services, the numbers that decide it, and what breaks.
SDE-2Senior
How to choose strong, causal or eventual consistency for each operation, the numbers that change the answer, and what breaks with each.
SDE-2Senior
When to make a database wait for its copies before it says saved, the numbers that change the answer, and what breaks with each choice.
SDE-2Senior
Senior and Staff
Decisions with no right side. How to decide, defend it with numbers, and change course later.
When to run two regions that both serve users and when to keep one on standby, with the money and risk numbers and the step-by-step path between them.
SeniorStaff
How to choose batch size and wait time when you group messages or writes, with the throughput gain, the latency cost and the data at risk worked out.
SeniorStaff
How to choose between running a component yourself, buying a finished product and using a cloud managed service, with cost, people and exit numbers.
SeniorStaff
When to split a system into independent cells that each serve a slice of customers, and when one shared system is the better buy, with the numbers.
SeniorStaff
How to decide how stale each service may be, by setting a delay budget for the whole user journey and sharing it among hops, with numbers and fallbacks.
SeniorStaff
Which to choose when users are in several countries: one global store, a store in each region, or a split by data type, with cost and law worked out.
SeniorStaff
How to choose between hedging, a narrower fan-out and partial results to cut slow tail latency, and what each costs in extra load.
SeniorStaff
How to choose how many spare servers to keep so a failure or a deploy causes no outage, with failure odds, cost and the zone-loss case.
SeniorStaff
When to change a large database table while the app runs, when to take a planned downtime window, and the numbers and fallbacks that decide it.
SeniorStaff
When to build a central platform team with a common way to deploy and run services, and when to let each product team choose and own its own tools.
SeniorStaff
How to choose between scaling after load arrives, scaling ahead from a forecast and keeping spare servers, with the cost and the lost requests.
SeniorStaff
How to balance shipping often against shipping safely: deploy on merge, staged canary rollout or a weekly release train, with error budget numbers.
SeniorStaff
How to mix committed, pay-as-you-go and spare-capacity servers to cut the cloud bill, with break-even use, regret cost and the safe order to start.
SeniorStaff
When to rebuild an old system from scratch and when to replace it piece by piece behind a routing layer, with cost, risk and delay worked out.
SeniorStaff
How to choose recovery targets and an availability goal by weighing what each extra nine and each minute of lost data costs against what it saves.
SeniorStaff
How to decide when to keep scaling a working system with cheap fixes and bigger machines, and when to re-architect, using runway, growth and cost.
SeniorStaff
When to run a service mesh, when a shared client library is enough, and when plain calls are best, with proxy cost, patching time and fallbacks.
SeniorStaff
When to let services share one database and when each should own its data, with connection, join, cost and team-speed numbers.
SeniorStaff
How to choose how a product stores each customer's data, with leak, migration, restore and cost numbers and a way to change later.
SeniorStaff
How to choose between keeping every trace, sampling a fixed share at the start, or picking which to keep at the end, with storage cost and missed-bug math.
SeniorStaff
Take an AI mock interview where the interviewer changes a number and asks if your choice still holds.