CodingLevel 2

Correctness review

Easynot started
Mediumnot started
Hardnot started
Spotting correctness bugsFinding the edge case that crashes the system.3 minMemory safetyDangling pointers and use-after-free crashes.3 minDates, time zones & encodingWhy 2:30 AM can happen twice in one night, and why emojis break string lengths.3 minDatabase bugs in codeWhy two simultaneous clicks on "Purchase" can sell the same concert ticket twice.3 minNumeric & money bugsWhy 0.1 + 0.2 doesn't equal 0.3, and why odometers roll over to 0.3 minFrontend bugs (React)Why your React interval is counting 0, 0, 0, 0 instead of 1, 2, 3.3 minAPI contracts & compatibilityWhy renaming a database column breaks mobile apps halfway across the world.3 minPaging a collection that keeps growingWhen rows are being inserted while you page, counting from the start of the list stops meaning anything, so point at a row instead of counting to one.7 minReviewing AI-generated codeWhy code that "looks perfectly correct" can subtly destroy your app.3 minStructured loggingWhy `console.log("User " + id + " failed")` is impossible to search at scale.3 minErrors a client can actually act onAn error response is a set of instructions for a program that cannot ask you a follow-up question.7 minPrecision vs recall in product termsOne dial, the threshold, trades blocking good customers against letting bad ones through. There is no setting that does neither.4 minInsecure deserializationWhen reading data turns into running code.3 minServer-side request forgery (SSRF)Turning your application into a proxy to attack the internal network.3 minAccessibility basics: keyboard, contrast, announceThe same form can be flawless with a mouse and unusable with a keyboard, a screen reader, or in grayscale, so you check it through those lenses.4 minCache evictionA small shelf with room for only a few things, when something new arrives, something old has to leave. The policy is the rule for choosing who goes.4 minDNS lookup hot loopWhy a simple loop can accidentally DDOS your DNS provider.3 minFile i/o: buffered vs directBuffered I/O routes reads and writes through the kernel page cache so repeats are fast; direct I/O skips the cache and talks straight to the disk.6 minFlushing to disk (fsync and the page cache)A successful write() only reaches the page cache, your data is durable only after fsync pushes those dirty pages down to the physical disk and waits for the device to confirm.5 minGRPC missing deadlinesWhy a fast microservice can take down your whole company if it forgets to set a timer.3 minHTTP Keep-Alive churnWhy opening and closing network connections is the slowest thing your server does.3 minHTTP streaming (server-sent events)How ChatGPT types its answers one word at a time over a single HTTP connection.3 minML inference serving (dynamic batching)How to maximize expensive GPUs by forcing impatient HTTP requests to carpool.3 minModel evaluation in PyTorchSwitch the model out of training mode, freeze the gradients, then count how often it was right.3 minPrototype pollutionWrite to __proto__ once and you've quietly added a property to every object in the program.4 minSocket short writeswrite() may accept fewer bytes than you gave it, you must loop until everything is sent, advancing past what was already written.4 minSQL index designAn index is the book's table of contents, it lets the database jump straight to a row instead of reading every page.4 minStreaming a downloadPour the river through a cup, a sip at a time, never try to hold the whole river at once.3 minTCP socket framingTCP hands you a river of bytes, not a stack of letters. To read your messages back out, you have to mark where each one ends.4 minThe PyTorch training loopEvery model you train is the same four lines on repeat: guess, measure how wrong, find which way is downhill, take a step.4 minUDP recv buffer truncationA datagram is all-or-nothing per read, too small a buffer means the tail is dropped on the floor, not saved for later.3 minUnbounded HTTP readsWhy trusting `readAll()` on a network socket is a fast track to an Out of Memory crash.3 minUploading a big file in partsCut a giant file into chunks, send each one on its own, then ask the server to glue them back together.4 minVerifying backups (checksum + test restore)A backup you have never restored is a hope, not a backup, pin it down with a checksum and an actual test restore.5 minWebSocket partial frame reassemblyA socket hands you bytes, not messages, so you keep a buffer and only deliver a message once every byte of it has actually shown up.5 min