This article explains why Redis’s single‑threaded design achieves high performance, details its five fundamental data types—string, list, set, hash, and sorted set—their internal implementations, and introduces advanced structures such as Geo, Bitmap, and HyperLogLog with practical command examples.
Redis achieves high performance by storing all data in memory, using compact data structures such as SDS, hash tables, skip‑lists and zip‑lists, running a single‑threaded event loop with I/O multiplexing, and applying optimisations like lazy‑free, progressive rehashing and optional multi‑threaded I/O for network traffic.
This article explains the concept and operation of Bloom filters, discusses their limitations such as false positives and deletion difficulties, introduces the Counting Bloom filter and Cuckoo filter as improvements, and explores their underlying hash mechanisms, performance trade‑offs, and optimization strategies.
This article explains how Redis internally stores set and sorted‑set objects using intset, hashtable, ziplist, and skiplist encodings, the conditions that trigger each representation, the upgrade process, and the essential Redis commands for manipulating these data structures.
This tutorial explains how to create, initialize, retrieve, update, and delete entries in Python dictionaries using both literal syntax and built‑in functions, demonstrates the use of the get, update, pop, and fromkeys methods, and shows common pitfalls and best‑practice code examples.
This article explains Python's four main composite data types—tuple, list, set, and dictionary—detailing their properties, mutability, typical operations, performance considerations, and appropriate use cases, accompanied by example code illustrating immutability of tuples.
An in‑depth guide to Redis’s core data structures—String, List, Hash, Set, and Sorted Set—detailing their characteristics, common commands, practical examples, and typical application scenarios such as caching, counting, messaging, and ranking, with code snippets and reference links.
This article explains Python's four main composite data types—tuple, list, set, and dictionary—detailing their characteristics, typical operations, performance considerations, and appropriate usage scenarios, while providing code examples and practical guidance for selecting the right structure in different programming contexts.
This article explains the concepts of time and space complexity, demonstrates their practical measurement with Python's list and set structures, and compares their lookup speed and memory consumption using concrete code examples and empirical results.
This article provides a comprehensive analysis of Go's map implementation, covering its hash‑table foundation, key type constraints, hash function characteristics, collision resolution strategies, runtime initialization, internal structures like hmap and bmap, and the various operations for creation, access, update, deletion, and resizing.
This article explains the motivation behind using filters to reduce database I/O, introduces Bloom filters and their bitmap implementation, discusses their limitations, then covers Counting Bloom filters and Cuckoo filters—including their hash structures, deletion support, performance trade‑offs, and practical improvements.
This article explains Redis's low‑level data structures—including ziplist, skiplist, intset, quicklist, zipmap and stream—detailing their memory layouts, implementation code, use‑case selection criteria, performance trade‑offs, and configurable parameters that balance speed and space.
The article explains Redis’s internal low‑level structures—ziplist, skiplist, intset, quicklist, zipmap, and stream—detailing their memory‑efficient layouts, operations, use cases, and how they combine (e.g., quicklist merging linked lists with ziplists) to deliver high performance in the in‑memory database.
This article explores Redis’s internal data structures—including simple dynamic strings, linked lists, and dictionaries—detailing their encoding constants, implementation differences across versions, performance advantages, and rehashing mechanisms that enable high‑throughput, memory‑efficient operations.
This article presents a comprehensive collection of practical Redis scenarios—including caching, distributed sessions, locks, global IDs, counters, rate limiting, bitmaps, shopping carts, timelines, message queues, lotteries, likes, tags, product filtering, recommendation models, and ranking—accompanied by example commands and Java code snippets for each use case.
The article details Redis’s core low‑level data structures—Simple Dynamic Strings (SDS) with length‑aware headers, a custom doubly linked list for O(1) head/tail access, and a hash‑table dictionary employing MurmurHash, incremental rehashing, and packed headers to optimize memory and performance across versions.
This article introduces Python's core built‑in sequence types—lists, tuples, dictionaries, and sets—explaining their characteristics, common operations, and performance considerations, and provides numerous interactive code snippets that demonstrate creation, indexing, slicing, modification, searching, sorting, and set algebra.
This comprehensive guide explains Redis's core and newer data types—including String, List, Hash, Set, Zset, BitMap, HyperLogLog, GEO, and Stream—detailing their internal implementations, essential commands, and practical scenarios such as caching, counting, locking, ranking, geolocation, and reliable message queuing.
This article explains why Java’s ArrayList uses a default initial capacity of 10, contrasts it with HashMap’s 16‑element default, and walks through the lazy‑initialization logic and growth algorithm that keep the capacity at ten until the first element is added.
This comprehensive C/C++ knowledge base covers everything from basic syntax, const, static, and this pointers to advanced topics like inline functions, virtual methods, smart pointers, STL containers, data structures, algorithms, operating system concepts, networking layers, and common interview problems, complete with code examples and diagrams.
This article explains why Redis is ultra‑fast by exploring its in‑memory design and the nine fundamental data structures—SDS, linked lists, ziplist, hash tables, skiplist, intset, quicklist, and listpack—that power keys, values, and internal objects, complete with code examples and version‑specific changes.
Explore Python’s fundamental composite data structures—lists, tuples, dictionaries, and sets—covering creation, indexing, modification, common methods, and built‑in functions like sum, len, max, and min, with clear code examples illustrating each operation in practice.
This comprehensive guide walks through Python fundamentals, covering numeric operations, base conversions, ASCII handling, logical checks, type casting, string manipulation, slicing, lambda usage, data structures, class definitions, object introspection, and useful built‑in functions, complete with clear code examples and explanations.
This article explains how Redis achieves high‑performance queries by leveraging in‑memory storage, specialized data structures such as SDS, hash tables, skip‑lists and zip‑lists, a single‑threaded event loop with I/O multiplexing, and progressive rehashing techniques.
The article explains the copy‑on‑write (COW) concurrency strategy, its suitability for read‑heavy scenarios, and demonstrates how Java implements COW with CopyOnWriteArrayList and CopyOnWriteArraySet, including volatile array handling, write‑locking, snapshot reads, and iterator behavior.
This article explains the basic structure of hash tables, how keys are mapped to array indices, the problem of hash collisions, and two common resolution strategies—open addressing and chaining—illustrated with diagrams and a concise summary.
This article explains the concept of Bloom filters, their probabilistic behavior and limitations, demonstrates how to integrate them into Redis via the RedisBloom module, and provides complete Java/Redisson examples for creating, populating, and querying Bloom filters to prevent cache penetration and duplicate processing.
This article explores Netty’s IntObjectHashMap, explaining how its use of primitive int keys and open‑addressing linear probing reduces memory overhead and improves performance compared to standard HashMap, while detailing its source‑code evolution, capacity handling, probing strategy, load factor, and deletion compaction.
This article explores how Netty’s IntObjectHashMap improves high‑concurrency ticket‑pricing scenarios by using primitive int keys, open‑addressing linear probing, and careful capacity adjustments, revealing the source‑code evolution, hashIndex optimizations, load‑factor tuning, and deletion compaction that together deliver significant memory and CPU savings.
This article explains the concept of hashing and hash tables, describes their characteristics and collision‑resolution strategies, showcases practical Python implementations with load‑factor handling and resizing, and highlights common applications such as dictionaries and network session tables.
This comprehensive guide explores Redis fundamentals, including NoSQL concepts, its five primary data structures, internal storage mechanisms, persistence options, replication, sentinel failover, and strategies to prevent cache penetration, breakdown, and avalanche, providing developers with deep insights for building robust, high‑performance applications.
This article explains the purpose and principles of database indexes, compares various tree structures such as binary search trees, AVL trees, B‑Trees and B+Trees, and shows how MySQL uses B+Tree indexes to minimize disk I/O and boost query performance.
This article provides a detailed introduction to internal and external sorting, compares the time‑complexities and stability of classic algorithms such as bubble, selection, insertion, shell, merge, quick, heap, counting, bucket and radix sorts, and includes complete Python code examples for each.
This article explains how Redis stores Set and Sorted Set objects using dual internal representations—intset and hashtable for sets, skiplist and ziplist for sorted sets—detailing their structures, encoding selection criteria, upgrade processes, command usage, and the reasons behind combining dictionaries with skiplists for optimal performance.
This article compiles a variety of online visualization tools—including algorithm and data‑structure animators, a MESI cache‑coherency simulator, and interactive TCP sliding‑window and flow‑control demos—to help learners intuitively understand core computer‑science concepts through animated models and hands‑on experimentation.
This article provides a comprehensive overview of fundamental data structures and algorithms, covering basic concepts, complexity analysis, case studies, and detailed examinations of structures such as HashMap, Bloom filter, SkipList, AVL, Red‑Black, B+Tree, and HashTree, while discussing their advantages, disadvantages, and typical use cases.
This article explains how Redis achieves high performance by using specialized in‑memory data structures such as SDS, quicklist, listpack, hash tables, skip‑lists and integer sets, detailing their design, evolution across versions, memory‑efficiency tricks, and the trade‑offs that make Redis a lightning‑fast key‑value store.
This article presents a comprehensive overview of Python’s 68 built‑in functions, categorizing them into numeric, data‑structure, scope, iterator, string execution, I/O, memory, file, module, and utility groups, and provides clear code examples for each to help beginners master Python fundamentals.
This article explains the JDK 1.8 HashMap resize/re‑hash optimization, showing how the new algorithm splits buckets instead of re‑hashing every entry, and includes the full source code and visual illustrations for single nodes, linked lists, and red‑black trees.
This article presents a comprehensive collection of Redis use cases—including caching, distributed locks, global IDs, counters, rate limiting, bitmaps, shopping carts, timelines, message queues, lotteries, likes, product tagging, filtering, follow relationships, and ranking—along with practical code snippets and command examples for backend developers.
Redis is an open‑source, in‑memory data‑structure store that serves as a database, cache, and message broker; this guide introduces its fundamentals, explains why NoSQL emerged, details its five primary data types, common commands, and advanced features like transactions and pipelines.
Learn how to implement a Least Recently Used (LRU) cache from scratch using a hash map combined with a doubly linked list in Java, covering the core concepts, node structure, get and put operations, and eviction logic to efficiently manage hot data.
This comprehensive guide walks you through Redis basics, its data structures, commands, installation steps, high‑concurrency principles, persistence mechanisms, replication, caching strategies, Lua scripting, pipelines, distributed locks, and cluster concepts, providing practical examples and best‑practice recommendations for developers and operators.
This article compares the lookup speed of Python lists and sets on large datasets, presents benchmark code and results, and explains why sets are dramatically faster by examining the internal C‑level implementations of list (dynamic array) and set/dict (hash table) including resizing rules and collision‑resolution strategies.
This article introduces Python’s collections module as a versatile alternative to built‑in containers, detailing the purpose, key methods, and practical code examples for Counter, defaultdict, OrderedDict, namedtuple, deque, and ChainMap, helping developers choose the right specialized container for their tasks.
This article explains why Redis achieves high query performance by leveraging in‑memory storage, specialized data structures such as SDS, linked lists, dictionaries, ziplists and skiplists, a single‑threaded event loop with I/O multiplexing, and various optimization techniques that avoid common bottlenecks.
Data StructuresI/O multiplexingPerformance Optimization
This article benchmarks Python list versus set lookups on large datasets, explains why sets are dramatically faster, and delves into the internal C‑level implementations of list as a dynamic array and set/dict as hash tables, including resizing rules and collision handling.
This article explains how to select Redis data structures such as Bitmap, HyperLogLog, Set, List, Sorted Set, and Hash to efficiently handle massive statistical scenarios like user login status, UV counting, ranking, and set aggregation, while providing concrete command examples and best‑practice recommendations.
This article explains the principles of skip lists, compares them with balanced trees, and provides a complete Go implementation—including interface design, random level generation, search, insertion, deletion, and iteration—while highlighting their space efficiency and ease of use.
This article examines whether Redis can serve as a reliable message queue by exploring its List, Pub/Sub, and Stream data structures, detailing their usage, advantages, drawbacks, and how they compare to dedicated queue middleware.
This article explains the motivation behind using probabilistic filters to reduce I/O, describes how Bloom filters, Counting Bloom filters, and Cuckoo filters work, analyzes their false‑positive and deletion problems, and presents practical optimizations such as multiple hash functions and multi‑slot buckets.
This article explains how Bloom filters, counting Bloom filters, and Cuckoo filters work, their advantages and limitations, and how they can be used to reduce unnecessary database I/O by efficiently testing element membership before querying the database.
This article provides a thorough introduction to Redis, covering its core data structures and common commands, persistence options (RDB and AOF), memory‑management and eviction policies, pipelining, transactions and Lua scripting, performance optimization techniques, replication, Sentinel high‑availability, cluster sharding, and a comparison of popular Java clients.
The article dissects Java’s HashMap put method, explaining how it computes a mixed hash, locates an index in a power‑of‑two table, inserts or replaces nodes in a linked‑list chain that may be converted to a red‑black tree, and triggers resizing when the load‑factor threshold is exceeded.
This article explains how Redis implements its Sorted‑Set using a skiplist, starting with the basics of a singly linked list, analyzing insertion and query complexities, deriving the skiplist structure and its O(log N) performance, and comparing it with hash tables, balanced trees, and B‑trees.
This article introduces the Python NetworkX library, covering its installation via Anaconda, fundamental graph creation, node and edge manipulation, attribute handling, directed and multigraph features, built‑in generators, analysis functions, and visualization with Matplotlib, all illustrated with concrete code examples.
This article explains why Redis achieves extremely high performance by being an in‑memory key‑value store, using compact data structures, a single‑threaded command model with epoll‑based I/O multiplexing, efficient hash tables, progressive rehashing, various persistence options, master‑slave replication, Sentinel monitoring and a sharded Cluster architecture.
The article explains how to quickly determine whether an integer exists among ten million numbers by comparing hash tables, boolean arrays, bitmaps, and Bloom filters, and shows practical Java and Redis implementations with code examples and memory‑usage analysis.
This article analyzes the Go‑implemented FreeCache library, detailing its project features, internal data structures, zero‑GC design, segment‑based locking for high‑concurrency thread‑safe access, the set operation workflow, index expansion, and its approximate LRU eviction strategy.
The article explains how Bloom filters, Counting Bloom filters, and Cuckoo filters work, their hash‑based bitmap mechanisms, advantages and limitations such as false positives and deletion issues, and presents practical improvements and hash functions for efficient cache and database query optimization.
The article explains the principles, advantages, and limitations of Bloom filters, introduces Counting Bloom filters as an enhanced version, and then details Cuckoo filters and Cuckoo hashing, including their algorithms, performance trade‑offs, and practical improvements for reducing unnecessary I/O operations.
This article explains Redis's ziplist—a compact list implementation used for small integers and short strings—by detailing its memory layout, field meanings, entry encoding schemes, the role of previous_entry, and the chain‑update behavior that occurs when nodes are added or removed.
This article explains the purpose of HashMap's load factor, the trade‑offs between space utilization and collision probability, describes common collision‑resolution techniques such as open addressing, rehashing and chaining, and shows why the default load factor of 0.75 is chosen based on Poisson‑distribution analysis.
This article introduces the fundamentals of data structures and algorithms, covering basic structures such as arrays and linked lists, common sorting algorithms, advanced structures like B+ trees and red‑black trees, explains Big O notation, and provides Java code examples for dynamic arrays, linked lists, queues, and stacks.
This article provides a comprehensive guide to Python's memory management and object assignment mechanisms, clearly explaining the differences between mutable and immutable objects, direct assignment, shallow copying, and deep copying through practical code examples and visual diagrams.
This article provides a thorough, English‑language overview of Java's Queue hierarchy, detailing the 18 concrete queue classes, their inheritance relationships, core methods, blocking variants, deque and transfer semantics, and practical code examples for each implementation.
This guide breaks down algorithm interview essentials into data‑structure fundamentals, complexity analysis, and core algorithmic thinking, highlighting the most frequent topics and offering a structured learning path plus a recommended book to help candidates prepare efficiently and boost their offer chances.
This guide breaks down the essential data structures, complexity analysis, and algorithmic thinking needed for software engineering interviews, highlights the 80% of topics that dominate most tests, and recommends a systematic study roadmap and a comprehensive book to boost interview success.
This article explains the core concepts of B‑trees and B+‑trees, compares them with red‑black trees, details their node definitions and insertion algorithms, and shows why B+‑trees are preferred for database and file indexing due to lower I/O cost and stable search paths.
This article explains the cache‑penetration problem in high‑traffic systems, introduces Bloom filters as a space‑efficient solution, details their construction and usage with Java and Redis examples, and discusses ways to reduce false positives and handle deletions.
This article provides a comprehensive overview of Redis, covering its definition, basic and special data structures, performance optimizations, expiration and eviction policies, common application scenarios, persistence mechanisms, high‑availability architectures, distributed lock implementations, transaction handling, and related algorithms such as Redlock and Bloom filters.
This article provides a comprehensive overview of Java collections, covering the definition, characteristics, differences from arrays, advantages, common collection classes, underlying data structures, fail‑fast mechanism, detailed List, Set, Queue, and Map interfaces, as well as HashMap and ConcurrentHashMap implementations and best practices.
This article provides a comprehensive list of typical Redis interview questions covering its features, performance, data structures, supported data types, common use cases, eviction policies, persistence methods, clustering, high‑availability mechanisms, transaction handling, and comparisons with local caches like Guava and Caffeine.
This article explains what an algorithm is, outlines its three essential properties, and introduces ten foundational computer algorithms—including sorting methods, Fourier transforms, Dijkstra's shortest‑path, RSA encryption, hash functions, factorization, link analysis, PID control, data compression, and random‑number generation—highlighting their historical origins and real‑world impact.
This article explains the internal data structures, hashing mechanisms, resizing behavior, and concurrency strategies of Java's HashMap and ConcurrentHashMap, covering their evolution from JDK 1.7 to 1.8, the use of linked lists, red‑black trees, and lock implementations.
This article presents a collection of Python programming examples covering function chaining, default‑argument traps, CSV file reading and writing, number‑base conversion, list flattening and merging, dictionary utilities, and common algorithmic patterns such as permutations and combinations.
This article explains Redis's fundamental and advanced data structures, outlines its single‑threaded in‑memory architecture, and provides practical guidance on scanning large keyspaces, spreading expiration times, and choosing between AOF and RDB persistence methods.
This comprehensive guide walks Java programmers through the ten classic sorting algorithms—bubble, quick, insertion, shell, selection, heap, merge, bucket, counting, and radix—detailing their principles, stability, time and space complexities, and providing clear Java implementations for each.
This article provides an in-depth overview of Java's Collections Framework, detailing the structure, usage, and source code of core interfaces like List, Set, Queue, and Map, and their key implementations such as ArrayList, LinkedList, HashSet, TreeSet, PriorityQueue, ArrayDeque, HashMap, and Hashtable, while highlighting performance characteristics and thread-safety considerations.
The article explains why Java's HashSet stores a non‑null placeholder in its underlying HashMap, detailing how HashSet#add and HashSet#remove delegate to HashMap methods and why using null would prevent these operations from correctly reporting success or failure.
This article explains red‑black trees, covering their definition, properties, relationship to 2‑3 trees, balance guarantees, time‑complexity analysis, and step‑by‑step insertion algorithms with rotations and color flips.
This article explains the Least Frequently Used (LFU) cache eviction strategy, contrasts it with LRU, and provides a complete Java implementation—including node definition, insertion, sorting, removal, and retrieval logic—along with a test scenario and discussion of LFU's drawbacks.
This article presents a collection of concise Python one‑liners—ranging from creating 2‑D lists and clamping numbers to generating Fibonacci sequences and converting strings to snake_case—each explained with clear code examples and practical use cases for everyday programming tasks.
This article explains Python lists as mutable sequences, demonstrates how to create, modify, slice, and iterate them, shows conversion from tuples and strings, lists common list methods, and compares lists with traditional arrays, providing clear code examples throughout.
This article explains the Redis Simple Dynamic String (SDS) data structure, comparing it with traditional C strings, detailing its struct layout, O(1) length retrieval, pre‑allocation strategy, lazy space release, and provides code examples illustrating how SDS avoids buffer overflows and improves performance.
This article explains Redis's ziplist compressed list structure, its internal fields, lookup algorithm, performance characteristics, configuration thresholds for Hash and List types, and demonstrates a real‑world use case with memory‑saving calculations and experimental results.
This article explains heap sort's time and space complexities, introduces max‑heap and min‑heap concepts, details the algorithmic steps for building and maintaining the heap, and provides a complete Java implementation with accompanying code examples.
This article explains the internal implementation of PHP arrays, detailing the _Bucket and _zend_array structures, hash table mechanics, packed versus hash arrays, and how PHP maintains element order through an auxiliary index table.
The article explains how to choose appropriate Redis data structures—such as Bitmap, HyperLogLog, Set, List, Hash, and Sorted Set—to efficiently handle massive statistical scenarios like UV counting, ranking, and set‑based aggregation, while providing concrete command examples and performance considerations.
This article explains what immutable data structures are, outlines their advantages such as reduced complexity, memory savings, easy state rollback, and functional programming benefits, and demonstrates practical usage of Immutable.js in React components and Redux integration with code examples and best‑practice tips.
The article provides a full‑length technical exam covering multiple‑choice questions on programming history, algorithms, networking and 5G, short answer queries about design patterns and tree operations, and coding challenges that ask participants to implement solutions for counting ways to eat bread, climb stairs, and analyze a C program that counts cycles in a permutation.
This article shares the author’s personal insights on a book about algorithms, data structures, and complexity, explaining core concepts such as algorithm definition, common data structures, time and space complexity, and offering intuitive examples to aid understanding.
This article explains the structural changes of ConcurrentHashMap in JDK 8, covering the new table layout, node types, hash spreading, initialization, resizing mechanics, treeification, and the lock‑free algorithms that enable concurrent expansion and high‑performance operations.
This comprehensive guide walks you through Redis fundamentals, data structures, persistence, high‑availability, performance tuning, and real‑world caching scenarios, providing the essential knowledge and interview tips needed to ace backend developer interviews focused on Redis.
This article explains how Nginx runs as a daemon with a master process and multiple worker processes, why it prefers a multi‑process asynchronous non‑blocking architecture over threads, and details the key internal data structures such as connections, requests, arrays, queues, lists, strings, memory pools, hash tables, and red‑black trees that enable its high‑performance HTTP handling.
This article introduces Python’s fundamental data structures—lists, tuples, sets, and dictionaries—detailing how to create them, use common methods, perform operations like concatenation, and understand their mutability with clear code examples.
This article explains how to use Redis Bitmap for binary state statistics such as user login status and daily sign‑in tracking, demonstrating memory‑efficient storage, relevant commands, and techniques for counting continuous sign‑ins across massive user bases.