AlgoMaster Logo

Skip Lists

Medium Priority17 min readUpdated October 25, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Premium Video

This video is available to premium subscribers only

Unlock Full Access

Many systems need to keep data sorted while it changes all the time. Leaderboards, in-memory database buffers, and sorted maps all need fast lookups, fast updates, and fast range scans at the same time.

A skip list is a sorted linked list with extra shortcut lanes above it. Those lanes let a search jump over large parts of the list instead of walking one node at a time.

In this chapter, we'll learn what a skip list is, how it uses randomness to keep a sorted collection fast to search and update, and why systems like Redis, RocksDB, and Java's concurrent collections use it.

1. The Problem

Suppose you're building a leaderboard for an online game with millions of players. Each player has a score, and these scores change constantly as people play.

The leaderboard needs to support several operations efficiently:

  • Update a player's score.
  • Display the top 100 players.
  • Find a player's current rank.
  • List players whose scores fall within a certain range, such as between 1,000 and 2,000 points.

To support these operations, the data needs to stay sorted by score. And with thousands of score updates happening every second, we need a data structure that can handle frequent insertions and deletions without becoming a bottleneck.

2. Why Arrays and Linked Lists Fall Short

Sorted Array

The simplest option is to use a sorted array. Searching is fast because we can use binary search.

But inserting a new score is expensive because we may need to shift all the elements that come after it to make room. With millions of players, a single insertion could mean moving millions of elements.

Sorted Linked List

Another option is a sorted linked list. Here, insertion is cheap once we know where the new element belongs. We just need to update a few pointers.

The problem is finding that position. Unlike an array, a linked list cannot jump directly to the middle. We have to start at the beginning and move through the nodes one by one:

StructureSearchInsert / Delete
Sorted arrayFast: O(log n) with binary searchSlow: O(n), elements must shift
Sorted linked listSlow: O(n), walk node by nodeFast once the position is found

So a sorted array gives us fast searches but slow updates, while a sorted linked list makes updates easy but searches slow. What we really want is a data structure that can do both efficiently.

3. Why Not a Balanced Tree?

Balanced binary search trees, like red-black trees and AVL trees, can solve this problem. They keep data sorted and support searching, inserting, and deleting in logarithmic time.

However, they also come with some challenges:

  • To maintain balance, these trees may need to perform rotations after insertions and deletions, and the rules for these rotations can be tricky to implement correctly.
  • An insertion may also require updating nodes along the path toward the root.
  • This becomes particularly challenging when multiple threads are updating the tree at the same time. If different threads need to modify nodes near the root, they have to coordinate their changes, which can limit concurrency.

Skip lists offer similar performance with a simpler structure that's easier to implement and can be more concurrency-friendly.

4. The Express Lane Idea

Premium Content

This content is for premium members only.