Practice
Each lab takes one setting from a board and lets you change it. Move the control and watch the numbers update. Labs run in your browser, and nothing you enter leaves the page.
System Design 16
The slate next to the stove
The slate is full and someone asks for something new. Which line gets erased?
One wala, many kettles
Sixteen customers, one wala. If the wala stops standing at each kettle, how much sooner is everyone served?
The order slip rail
The kitchen is 95% busy. How much longer do you wait than at 50%?
Splitting the ledger
Names are mostly A–D. You split A–M / N–Z. What happens?
The bouncer at the door
The limit is 5 a minute. How many can one client land in a two-second span?
The copy clerks
You pay your tab at stall A and walk to stall B. What do they say you owe?
The cut phone line
The line between the branches is cut. What does the far clerk say to the customer in front of them?
Charged twice
The reply never arrived. Did the money move, and what should the client do?
Who holds the pen
The room splits in two. Both halves think they are in charge. Who is allowed to write?
The two ledgers must agree
One transfer, two books, and a crash that lands between them. Where does the money end up?
The right book for the job
Fourteen real queries, six datastores. Which one answers yours without a second system?
The ledger everyone reads
The same answer is correct under one promise and a violation under another. Which promise did you make?
The ring
The ring rehomes only 1/N of the keys when a server dies. So why does everyone run two hundred virtual nodes per server?
Thirty stalls on one order
Every stall is slow one time in a hundred. An order that waits on a hundred stalls is slow how often?
Counting the crowd
A hundred thousand different customers, and a tally board of 12 KB. How far off is its count?
The last vada
Ten vadas left and a crowd reaching at once. How does the stall sell exactly ten, and what does making sure cost?
AI 10
Tokens and embeddings
One sentence, one tokenizer, a vocabulary you can grow. How many tokens does it cost?
The batch size dial
One GPU, one chat, cores 99% idle. How many more chats fit before anything gets slower?
The temperature dial
The model has read 'The weather today is'. How often does it say something other than sunny?
The decision threshold
The filter has scored every email. How sure must it be before one goes to the spam folder?
Many experts, one router
Doubling the experts doubles what the model knows and costs nothing per token. So what does it cost?
The loop cap
The returns desk's loop keeps asking the model until it answers. How many passes before it hands the customer to a person?
The chunk size
The returns desk cuts its policy into pieces and hands the model the best few. How big should a piece be, and how many should go in?
The learning rate
Every step of training walks the dials downhill. How far should each step go?
The cascade threshold
Every request goes to the small model first. How sure must it be before its answer goes out?
The LoRA rank
Fine-tuning a 7B model with LoRA trains a small correction beside the frozen weights. How big should the correction be?
How Computers Work 8
The memory hierarchy
Same data, same O(n), four access patterns. Why is one of them 31 times slower?
The interrupt storm
The device taps the CPU on every event. What happens when it taps a million times a second?
Cache line life
You asked for four bytes. Sixty-four arrived. Who paid for the other sixty, and who else wanted them?
Inside a float
Your program stores 0.1. What is actually in those 64 bits?
The fsync interval
Your write returned and the power cut a moment later. Is the record on the disk?
The parallel ceiling
Ninety-five percent of the job splits across cores. How much faster can it possibly finish?
The working set
The program needs twelve pages at once. What happens when it gets eleven frames?
The time slice
Three long jobs are running when you press a key. How long until the keypress gets the CPU?
DSA 7
O(1) yaad
A hash map answers in one step, on average. What is the worst case, and when does it start to matter?
Sorting aur searching
Merge sort is O(n log n) and insertion sort is O(n squared). On the list you actually have, which does less work?
How cost grows
A million items. O(n log n) finishes in a blink. How long does O(n²) take?
The cliff at n = 11
Ten cities, and you can check every possible route. Eleven, and you cannot. So what do you ship for the eleventh?
The DP table
The same recursion runs three ways. Which one solves ways(3) fifty-five times, and which solves it once?
The greedy bet
Grabbing the biggest coin that fits gives the fewest coins with 1, 5, 10 and 25. Does it with any coins?
The short chains
Every find walks a chain of houses up to the root. In the worst order, how long can that chain get, and what keeps it short?
Mind Blown 6
The 99 percent test
The test is 99% accurate and you tested positive. What are the odds you have it?
The shortcut that slows everyone
The new road is free, instant, and takes nothing away. Why is everybody's drive fifteen minutes longer?
The birthday collision
Twenty-three people and 365 days. Why is a shared birthday a coin flip, and what does that cost you in bits?
The door switch
You picked a door and the host showed goats behind the others. Should you switch?
The fee that compounds
A fund charges 1% a year. How much of your final balance does it take over thirty years?
The flipped total
Open surgery wins on small stones and on large stones. How does it lose overall?
Game Theory 6
Repeated games
Betraying is the rational move in a single game. How many rounds before staying silent starts to win?
The second-price auction
It is worth 70 coins to you. What should you write on the slip?
The empty threat
The incumbent swears it will start a price war if you enter. When should you believe it?
Hawks and doves
Some birds always fight for food and some always back off. What share of fighters does a population settle at?
The lemon market
Buyers can't tell a good used car from a lemon. How many lemons does it take before good cars stop selling?
The price war
Two sellers share a market. Does competition between them push the price all the way down to cost?
DevOps 6
The load balancer
Every algorithm looks identical on the benchmark. Which one is still standing when two requests in a hundred cost sixty times the rest?
The two gates
Your packet passed both gates on the way in. Does the answer get back out?
The autoscaler lag
Your traffic goes up eightfold in three minutes and the HPA is working perfectly. Who still gets an error?
The restore drill
A backup every night, and someone drops the main table at 11:59 pm. What is the cheapest way to lose under a minute of writes instead of a day?
The berth plan
Each ship books quay space before it docks, and the harbour master trusts the booking. How much should a ship book?
The spot share
Spot is 63.6% cheaper than on-demand, and it can be taken back. How much of the fleet should run on it?
Finance 6
The minimum payment
You owe 5,000 at 24% a year. What does paying 100, 110 or 250 a month actually buy you?
One cloud, many rivers
Each river swings 20% a year and shares some weather. Own a hundred: how much does your water still swing?
The drought right
A right to buy one barrel of water at 100 in a year, when water costs 100 today. What is it worth, and what makes it worth more?
The borrowed bucket
Borrow two buckets for every one you own and pour all three into a market averaging 7% a year. Do you end up with more water?
The netting window
Three banks send each other 48 payments in a day. Settle each the moment it is made, or pay only the difference at 17:00?
The nightly match
Card payouts reach the bank days late, and two payments never arrive. How long should an entry wait for its twin before someone is told?
Networking 5
One address, many doors
Move the split one bit and the street halves. How many machines fit, and how do they share one public address?
The lost page
The post loses one page in ten. What should you send again - and how much does the answer cost?
The TCP handshake
The pipe is 100 Mbps and the file is 1 MB. Why does the round-trip time decide how long it takes?
The TTL dial
You changed the address. How long until the world stops sending people to the old one?
The full buffer
A bigger waiting yard means fewer parcels turned away. Why does it make the whole house feel slower?
Data Systems 4
LSM vs B-tree
Write-heavy wants an LSM, read-heavy wants a B-tree. Where exactly is the flip?
Isolation levels
Two doctors each check that someone else is on call, both go off call, and both commit. Which level notices?
The late tap
A tap from a phone in a tunnel arrives twenty seconds late. How long should the server wait before showing a count?
The heartbeat timeout
A follower sends a heartbeat every second and the leader gives up after some silence. How much silence is enough?
Database Internals 4
The selectivity crossover
Your query has an index and Postgres refuses to use it. At what fraction of the table does reading all of it in order start to win?
The vacuum lag
One transaction has been open for an hour and nobody noticed. Why is the table three times the size of its data?
The write-ahead log
You checkpoint three times as often for a faster restart. Why does the log get bigger?
The work_mem dial
Your sort spills to disk. Give it more memory and it stops. Why does nobody set work_mem to a gigabyte?
How Things Work 4
The overloaded strip
One extension strip, one fuse, one cord. Plug in one more thing. Which fails first?
The stopping distance
A child steps out where a 50 km/h car would just stop. How fast is a 60 km/h car still going there?
The heat pump
A fridge and an air conditioner run the same loop. Why does one move twice as much heat per joule?
The muggy night
It is 40 °C. Does a fan help, and does the answer change when the air is wet?
Security 3
The revocation window
You sign a stolen login out everywhere. How long does the thief's copy keep working?
The slow hash
A million password hashes have been stolen. How much does a slower hash actually buy you?
The chain
An attacker must get through every stage of a breach unseen. How good must each control be?