
Big‑O, Allocation, and Measured JavaScript Performance
Compare JavaScript algorithms using growth, allocation, and measured runtime, with a runnable experiment that makes input distribution and setup costs explicit.
Articles
Algorithms are the repeatable problem‑solving patterns we use when brute force is no longer good enough. In web development they show up far beyond interview preparation, wherever the order or cost of work matters. A lot of my articles here overlap with LeetCode, but the category is broader than that; it is about recognising the techniques that make difficult problems easier to reason about in JavaScript and TypeScript.

Compare JavaScript algorithms using growth, allocation, and measured runtime, with a runnable experiment that makes input distribution and setup costs explicit.

Build immutable range sums in TypeScript with a padded prefix array, precise inclusive indices, snapshot semantics, and tests against direct addition.

Solve Word Search with backtracking in JavaScript, covering recursive path exploration, visited state, pruning, restoration, and grid trade‑offs.

Solve Linked List Cycle with fast and slow pointers in TypeScript, comparing visited‑node storage with Floyd's cycle detection and common mistakes.

How to solve Number of Islands with grid traversal, treating the matrix like a graph, marking visited land safely, and reasoning about DFS in TypeScript.

Multiply decimal strings in TypeScript without converting whole inputs, using place‑value buckets, a separate carry pass, and exact reference tests.

How to solve Longest Substring Without Repeating Characters with sliding window basics, comparing Set and last‑seen‑index approaches in TypeScript.

Implement Pow(x, n) in TypeScript using exponentiation by squaring, with negative exponents, JavaScript bitwise traps, and sensible floating‑point tests.

How to solve Trapping Rain Water with the two‑pointer approach, and the simple invariant that makes the O(n) solution click under interview pressure.

Choose JavaScript number, BigInt, or digit strings for algorithms, with safe‑integer limits, bitwise traps, exact counts, and floating‑point comparisons.

Find a maximum‑probability path in TypeScript using a max heap, product‑based relaxation, stale arrivals, zero‑probability edges, and numerical tests.

Solve Merge Intervals in TypeScript by sorting ranges, merging overlaps, handling touching intervals, preserving inputs, and avoiding common mistakes.

Solve Path With Minimum Effort in TypeScript using a min heap, a minimax relaxation rule, stale‑entry checks, and an independent threshold‑search reference.

How to solve Product of Array Except Self without division, using prefix and suffix products to keep the logic linear and interview‑safe in TypeScript.

nth Node from the End of a ListRemove the nth node from a linked list in TypeScript. Compare the two‑pass and pointer‑gap approaches, their edge cases, types and linear‑time complexity.

Distinguishing two approaches to detect palindrome numbers: the intuitive string method vs. the optimised mathematical technique, highlighting their merits.

Build a Time Based Key‑Value Store in TypeScript with append‑only histories and upper‑bound search, covering missing keys, time gaps, and ordering assumptions.

Find the median of two sorted arrays in TypeScript, comparing a sorting baseline with binary partition, worked cuts, edge cases, and logarithmic complexity.