Java Collections & Data Structures
Technical essays and low-level architectural breakdowns exploring mechanical execution, system trade-offs, and engine internals.
Mastering Java Collections from First Principles: Series Introduction & Learning Roadmap
Discover what you will learn in this 25-part series on Java Collections internals. Build data structures from scratch and master memory mechanics.
Java Memory Model Explained: Stack vs Heap Allocation for Arrays
Understand how the JVM allocates memory on the stack and heap when declaring primitive and object reference arrays in Java.
Java equals() and hashCode() Contract: Avoiding Silent HashMap Bugs
Learn the unbreakable contract between equals() and hashCode() in Java to prevent silent HashMap lookup bugs and memory leaks.
How Java ArrayList Works Internally: Building a Dynamic Array from Scratch
Build a custom ArrayList in Java from scratch. Understand dynamic array resizing, System.arraycopy performance, and garbage collection.
Java LinkedList Internals: Building a Doubly Linked List from Scratch
Learn how Java LinkedList works under the hood by building a doubly linked list. Compare ArrayList vs LinkedList performance trade-offs.
Java Iterator and modCount: How Fail-Fast Iteration Prevents Data Corruption
Explore how Java iterators use modCount to throw ConcurrentModificationException and prevent silent data corruption during list traversal.
Building a Custom Java Stack: LIFO Mechanics & Why Legacy Stack is Broken
Build a custom LIFO Stack in Java. Learn why java.util.Stack is obsolete and how ArrayDeque provides better performance.
Building a Circular Queue in Java: Array Ring Buffers and Modulo Math
Build a high-performance circular array queue in Java. Eliminate O(N) array shifts using modulo arithmetic head and tail pointers.