Languages and Runtimes
The surprises inside everyday code: numbers, strings, scope, hidden costs, and what the runtime does behind your back.
Floating Point
0.1 + 0.2 is not 0.3. 0.1 has no exact binary form, so the sum lands a hair past 0.3.
Not started.Beginner8 minInteger Overflow
Math.abs() returned a negative number. What happens when a value does not fit in 32 bits.
Not started.Beginner7 minUnicode and String Length
One emoji on screen, length five. Code points, joiners, and why length is not what you see.
Not started.Beginner8 minSorting Text That Looks Like Numbers
Sort "10", "9", "2" and "10" comes first. Strings are compared character by character.
Not started.Beginner5 minPython's Mutable Default Arguments
A list used as a default argument is built once and shared by every call.
Not started.Beginner6 minThe Real Cost of Python Operations
Eight everyday list, dict and set operations with what they cost. Swapping [ ] for { } turns 5,000 checks into 1.
Not started.Beginner9 minJavaScript Closures in Loops
Three timers in a loop all print 3. Every callback shares one variable, and the loop has finished before any of them runs.
Not started.Beginner7 minJavaScript Type Coercion
[] == ![] is true. Each conversion the comparison makes, one step at a time.
Not started.Beginner7 minString Concatenation in a Loop
Every += copies everything written so far. The hidden O(n²), and the builder that removes it.
Not started.Beginner6 minAsync/Await: In a Row or Together
Three awaits in a row wait three times. Start them together and the waiting overlaps.
Not started.Beginner7 minThe Call Stack
Recursion is a tall stack: each call adds a frame, then the tower pays back from the top. Remove the base case and it overflows.
Not started.Beginner8 minPseudo-Random Numbers
A generator with a seed produces a sequence. Run the same seed again and the same numbers come out, in the same order.
Not started.Beginner6 minGarbage Collection: Mark and Sweep
Who deletes your objects? The collector marks everything reachable from the roots and sweeps away the rest.
Not started.Intermediate9 minCPU Caches and Loop Order
The same two loops, swapped, run several times slower. Memory is read in lines, and one order uses them well.
Not started.Intermediate8 min