// TOPIC

#data-structures

24 articles

Beginner
01

What Is a Data Structure?

A data structure is a deal you strike — you give up something to make one operation fast. Here is the big picture before you dive into any of them.

#fundamentals#data-structures#computer-science
8 min
Beginner
02

Stacks and Queues: Order Matters

The two simplest constrained collections in CS — and the ones that show up everywhere once you know what to look for. Understand LIFO vs FIFO, how the call stack works, and when each structure is exactly the right tool.

#stacks#queues#data-structures
8 min
Beginner
03

Trees: When Data Branches

Move beyond flat lists and discover why trees power everything from file systems to databases. Learn nodes, roots, leaves, height, and how a balanced tree buys you O(log n) on a silver platter.

#trees#data-structures#fundamentals
10 min
Beginner
04

Graphs: Everything Is Connected

The graph data structure models the real world — maps, social networks, dependencies — better than any other. Learn how nodes and edges work, how to represent them, and how BFS and DFS let you actually do something useful with them.

#graphs#data-structures#bfs
10 min
◆◆Intermediate
05

Choosing the Right Data Structure

The meta-skill every engineer needs — a decision framework that maps your dominant operation to the right structure, so you stop guessing and start choosing deliberately.

#data-structures#decision-framework#fundamentals
11 min
◆◆IntermediateGoogleAmazon
06

Union-Find (Disjoint Set Union)

The near-magic data structure for connectivity queries — are these two nodes in the same component? Nearly O(1) per operation with union by rank and path compression. Kruskal's MST, redundant connections, account merging, and more.

#union-find#disjoint-set-union#graphs
11 min
◆◆IntermediateGoogleAmazon
07

Tries (Prefix Trees)

The data structure powering autocomplete, spell-check, and IP routing — a tree where each edge is a character and every path from the root spells a prefix. Insert, search, and prefix queries all run in O(L) on word length alone, completely independent of how many words you store.

#tries#trees#strings
11 min
BeginnerAmazonGoogle
08

Strings

Strings look like simple text, but they hide a brutal trap: naive concatenation in a loop is O(n²). Learn why, how encoding actually works, and the handful of patterns — sliding window, two pointers, hashing — that solve 80% of string interview problems.

#strings#arrays#fundamentals
12 min
◆◆◆AdvancedGoogleMeta
09

Segment Trees

Segment trees answer range queries AND handle point or range updates in O(log n) — the structure to reach for when prefix sums aren't enough and you need both reads and writes at scale.

#segment-trees#trees#range-queries
13 min
◆◆IntermediateAmazonGoogle
10

LRU Cache

The definitive guide to the LRU cache — how to combine a hash map and a doubly linked list to get O(1) get and put, why neither structure alone is enough, and how to walk the full implementation in an interview.

#lru-cache#hash-tables#linked-lists
11 min
BeginnerAmazonGoogle
11

Hash Sets

A hash set is a hash table with the values ripped out — pure O(1) membership, dedup, and "have I seen this?" tracking. Master it and a whole class of O(n²) problems collapse to O(n).

#hash-sets#data-structures#hashing
12 min
◆◆◆AdvancedGoogle
12

Fenwick Trees (Binary Indexed Trees)

Fenwick trees give you O(log n) prefix-sum queries AND point updates in ~10 lines of code — leaner and faster in practice than a segment tree for this exact job. Learn the lowbit trick, build the tree, and know when a BIT beats everything else.

#fenwick-tree#binary-indexed-tree#prefix-sums
13 min
BeginnerAmazonGoogle
13

Deques (Double-Ended Queues)

A deque gives you O(1) push and pop from both ends — and the sliding-window-maximum trick that turns O(n²) brute-force problems into clean O(n) solutions.

#deques#queues#stacks
11 min
◆◆◆AdvancedGoogleAmazon
14

Bloom Filters

A probabilistic set that answers "definitely not" or "maybe yes" using a bit array and k hash functions — orders of magnitude smaller than a hash set, with a tunable false-positive rate and mathematically guaranteed zero false negatives.

#bloom-filters#probabilistic-data-structures#hashing
12 min
◆◆◆AdvancedGoogleAmazon
15

Balanced BSTs (AVL & Red-Black Trees)

Self-balancing trees fix the degenerate-BST problem by keeping height O(log n) guaranteed — which is why Java's TreeMap, C++'s std::map, and every ordered set in the standard library runs on one under the hood.

#trees#binary-search-trees#balanced-trees
13 min
BeginnerAmazonGoogle
16

Stacks

The stack data structure explained from first principles — LIFO semantics, O(1) push and pop, and why it shows up everywhere from your call stack to balanced-parentheses checkers.

#stacks#data-structures#fundamentals
9 min
BeginnerAmazonGoogle
17

Queues and Deques

The queue data structure enforces one rule — first in, first out — and that rule shows up everywhere from BFS to task schedulers. Learn how to get O(1) on both ends without the hidden tax of a naive array.

#queues#data-structures#bfs
10 min
BeginnerAmazonMicrosoft
18

Linked Lists

The linked list data structure explained from first principles — nodes, pointers, O(1) insert at a known position, and why arrays still win most of the time.

#linked-lists#data-structures#pointers
11 min
◆◆IntermediateAmazonGoogle
19

Heaps and Priority Queues

The heap data structure gives you O(1) peek at the min (or max) and O(log n) insert and extract — the exact shape you need for scheduling, K-way merging, and the top-K pattern that shows up everywhere in systems interviews.

#heaps#trees#priority-queues
10 min
◆◆IntermediateGoogleAmazon
20

Hash Tables

The interview MVP. How hash functions turn arbitrary keys into O(1) lookups, what actually happens during a collision, and why "just use a hash map" is usually the right instinct.

#hash-tables#data-structures#hashing
10 min
◆◆IntermediateGoogleMeta
21

Graphs

The data structure that models everything connected — social networks, road maps, dependency chains, and more. Master representations, traversals, and the "model it as a graph" reframe that unlocks whole categories of problems.

#graphs#data-structures#bfs
11 min
◆◆IntermediateAmazonMeta
22

Binary Trees and Traversals

Master binary tree traversal — inorder, preorder, postorder, and level-order — and the recursive mindset that makes dozens of tree problems click instantly.

#trees#binary-trees#traversals
11 min
◆◆IntermediateAmazonGoogle
23

Binary Search Trees

The left<node<right invariant gives you O(log n) search, insert, and delete — until the tree degenerates into a linked list. Here's the full picture, including why inorder traversal is a free sort.

#trees#data-structures#binary-search
11 min
BeginnerAmazonGoogle
24

Arrays

The data structure everything else is built on. Why arr[i] is instant, why inserting in the middle hurts, and the handful of patterns that turn arrays into interview wins.

#arrays#fundamentals#data-structures
6 min