Blog
Notes on data structures & algorithms, system design, and things I learn along the way.
Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→Four array methods replace most of the for-loops you'll ever write. What map, filter, reduce and find each do, step by step, how to chain them, and when a plain loop is still the better choice.
A hash function maps any input to a fixed-size number, the same input always to the same number. How a simple one works, why collisions are unavoidable, what makes a hash good, and how the same idea powers hash maps, caches and passwords.
The browser turns your HTML into a tree of objects, and that tree — not the HTML file — is what's on screen and what JavaScript changes. How to find, change, create and remove elements, and how events travel through the tree.
The two most basic ways to store a sequence. Arrays keep items side by side for instant access by position; linked lists chain scattered nodes for cheap inserts. What each operation costs, and why arrays win most of the time anyway.
A callback is a function you hand to another function to call later. Why JavaScript is built on them, the difference between synchronous and asynchronous callbacks, and how 'callback hell' led to promises and async/await.
Three ways to declare a variable, and the differences that actually matter: block scope vs function scope, the loop bug that var causes, and what const does (and doesn't) protect. A beginner's guide with one simple rule at the end.
In TypeScript, a value fits a type if it has the right properties — no matter what it's called or where it came from. How structural typing works, the excess-property check that seems to contradict it, and how to opt into nominal types with brands.
Define a type once, then derive the variations — update payloads, public views, dictionaries — so they can never drift apart. The built-in utility types, and the mapped-type machinery (keyof, in, T[K]) they're built from.
Give every member of a union a shared literal field, and TypeScript can tell them apart — narrowing in each branch and refusing to compile when a case is forgotten. The pattern behind loading states, reducers and API results.
A union type means “one of these — find out which before you use it”. How typeof, equality, in, instanceof and early returns narrow a type line by line, and how to write your own type guards.
148 posts · page 5 of 15