Data Structures
Data structures and algorithms, from core concepts to system design
Learn how data structures organise memory, how algorithms operate on that memory, and how to select complementary pairs to design scalable systems.
Plain words. One step at a time. Nothing here assumes you already know the idea.
The idea
A data structure is a specialised format for organising, processing, retrieving, and storing data in computer memory. An algorithm is a finite, step-by-step sequence of well-defined instructions designed to perform a specific computation or solve a given problem. While data structures represent passive arrangements of state, algorithms represent the active procedures that transform and query that state.
Consider a public library.
You will need. Basic programming syntax in Python · Understanding variables, loops, and conditional statements
One pass
Step 1 of 3
Every program consists of two fundamental components: data and operations. A data structure answers the question of how information rests in memory. For instance, storing a group of user identifiers can be done in a contiguous list where elements sit next to each other, or in an associative mapping where each identifier maps directly to a location.
Smallest version
Linear search algorithm operating on an array data structure
def contains_item(data: list[int], target: int) -> bool:
for item in data:
if item == target:
return True
return False
numbers = [2, 4, 7, 9]
found = contains_item(numbers, 7)
print(found)Keep these
- A data structure stores and arranges elements in memory.
- An algorithm executes a finite series of steps to compute a result over data.
- An algorithm's implementation and efficiency directly depend on the underlying data structure.
Try one
Unsorted to set lookup
easy
Also on MonksBit
- How to Choose the Right Data Structure for Your Algorithm Learn how to match programmatic access patterns, update frequencies, and memory budgets to the most efficient data structure. Data Structures · 8 min
- How Data Structures Impact Software Performance and Scalability Discover how choosing the right data structure directly impacts software runtime, memory usage, and architectural scalability through concrete comparisons. Data Structures · 8 min
- Database Replication Explained: From Single-Leader to Distributed Consensus Master the principles of database replication, evaluate consistency models, and build resilient single-leader and multi-replica architectures. System Design · 7 min
- Database Normalization vs. Denormalization: From Data Anomalies to High-Throughput Systems Design clean relational schemas up to Third Normal Form and selectively denormalize storage to optimize real-world read latency. System Design · 9 min
- Database Indexing & Query Optimization: A Complete Guide from Scratch Understand how relational database indexes store data, accelerate lookups, and guide query planning across real-world systems. System Design · 9 min
- Database Transactions & ACID Properties: Ensuring Data Integrity in System Architecture Learn how database transactions guarantee correctness using ACID properties, write a transaction manager in Python, and master isolation anomalies. System Design · 8 min
- Database Schema Design & Data Modeling: From Conceptual Entities to Physical Storage Design clean, normalized database schemas, handle relationships, enforce relational integrity, and optimize storage with practical indexing and denormalization strategies. System Design · 9 min
- SQL vs. NoSQL Databases: From Data Modeling to Distributed Scaling Learn the mechanical differences between relational and non-relational databases, how data models impact scaling, and how to select the right persistence layer. System Design · 10 min
- Data Serialization Formats Explained: JSON and XML vs. Binary Schemas (Protobuf, Avro) Master data serialization, compare text and binary representations, and implement reliable encoding, parsing, and schema validation in Python. System Design · 9 min
- Synchronous vs. Asynchronous Communication in Distributed Systems: Patterns, Trade-offs, and Use Cases Design and implement reliable communication patterns between services using blocking calls, background queues, and decoupled messaging. System Design · 8 min
- The HTTP Request-Response Lifecycle: From TCP Socket Parsing to Application Middleware Trace an HTTP interaction end-to-end through socket handling, protocol parsing, middleware pipelines, routing, and serialized responses. System Design · 9 min