Topic
data structures
29 articles across 3 sub-topics
Sub-topic
26 articles
HyperLogLog Explained: Counting Billions of Unique Items with 12 KB
TLDR: HyperLogLog estimates the number of distinct elements in a dataset using ~12 KB of memory regardless of cardinality — with ±0.81% error. The insight: if you hash every element to a random bit string, the maximum length of leading zeros you obse...
Count-Min Sketch Explained: Frequency Estimation at Streaming Scale
TLDR: Count-Min Sketch (CMS) is a fixed-size d × w counter matrix that estimates how often any element has appeared in a stream. Insert: hash the element with each of the d hash functions to get one column per row, increment those d counters. Query: ...
Bloom Filters Explained: Membership Testing with Zero False Negatives
TLDR: A Bloom filter is a bit array of m bits + k independent hash functions that sets k bits on insert and checks those same k bits on lookup. If any checked bit is 0, the element is definitely not in the set — false negatives are mathematically imp...
Big O Notation Explained: Time Complexity, Space Complexity, and Why They Matter in Interviews
TLDR: Big O notation describes how an algorithm's resource usage grows as input size grows — not how fast it runs on your laptop. Learn to identify the 7 complexity classes (O(1) through O(n!)), derive time and space complexity by counting loops and ...
Probabilistic Data Structures: A Practical Guide to Bloom Filters, HyperLogLog, and Count-Min Sketch
TLDR: Probabilistic data structures trade a small, bounded probability of being wrong for orders-of-magnitude better memory efficiency and O(1) speed. Bloom Filters answer "definitely not in this set" in constant time with zero false negatives. Hyper...

Two Pointer Technique: Solving Pair and Partition Problems in O(n)
TLDR: Place one pointer at the start and one at the end of a sorted array. Move them toward each other based on a comparison condition. Every classic pair/partition problem that naively runs in O(n²) collapses to O(n) with this one idea — and masteri...
Sub-topic
2 articles

Redis Sorted Sets Explained: Skip Lists, Scores, and Real-World Use Cases
TLDR: Redis Sorted Sets (ZSETs) store unique members each paired with a floating-point score, kept in sorted order at all times. Internally they use a skip list for O(log N) range queries and a hash table for O(1) score lookup — giving you the best o...
LLD for LRU Cache: Designing a High-Performance Cache
TLDR TLDR: An LRU (Least Recently Used) Cache evicts the item that hasn't been accessed the longest when it's full. The classic implementation combines a HashMap (O(1) lookup) with a Doubly Linked List (O(1) move-to-front) for overall O(1) get and p...
Sub-topic
1 article
Python Data Structures: Lists, Dicts, Sets, and Tuples
TLDR: Python's four built-in collections are not interchangeable — their internals are fundamentally different. list is a dynamic array: fast at the end, slow for membership. dict is a hash table: O(1) key lookup, insertion-order-preserving since Pyt...
