1. Array
Start your learning journey by understanding the most fundamental data structure.
2. Singly Linked List
Learn in-depth the most fundamental data structure in a programmer's life
6. Queue
Learn about the data structure that powers CPU and disk scheduling algorithms
7. Binary Tree
Learn all about the most critical data structure in computer science
What you will learn
How linked lists scatter nodes across memory and trade random access for O(1) head insertion
The reversal pattern in both forms: direct list reversal and reversal as a subproblem
Sliding window traversal using two references kept a fixed distance apart
Fast and slow pointers for middle node search, cycle detection, and palindrome checks
Split, merge, and reorder using dummy heads and parallel tail references
How Floyd's tortoise and hare algorithm finds a cycle in O(N) time and O(1) space
Why this course
A linked list is a node holding a value and a pointer to its neighbour. Defining it takes one sentence. Reversing one without losing the rest of the list, finding the middle in a single pass, or merging two sorted chains in place is choreography: three references moving in the right order, any slip erasing half the list. The trouble is rarely the structure. It is the pointer hygiene.
This course rebuilds singly linked lists from the single-node primitive up, then walks through the seven pointer manipulation patterns that cover almost every linked list question you will see in a coding interview. You finish by implementing a singly linked list of your own with every supported operation working at its tightest complexity.
Requirements
The course assumes you can read code in any mainstream language and have written a function or two that mutates an object through a reference.
- Comfort writing loops, conditionals, and small functions in at least one language.
- A working idea of references or pointers (passing an object into a function and mutating it from inside).
- Basic Big-O notation literacy: O(N), O(1), O(log N).
Overview
A singly linked list is the data structure that motivates every other pointer-based structure in computer science. Stacks, queues, hash table chains, trees, graphs, and adjacency lists all sit on the same primitive: a node with a value and a reference to its neighbour. It is also where most engineers first meet the cost of indirection. Walking an array of one million integers stays in cache; walking a linked list of one million nodes touches one million scattered addresses, which is why production systems often prefer arrays even when textbook complexity favours a list.
Representation of a singly linked list
The course teaches both halves of the topic: how the structure works at the pointer level, and how to recognise which of the seven patterns a given problem fits into.
Fundamentals
The course opens with the node, the primitive every linked list operation manipulates. You see how each node packages a data field with a next reference, how a head pointer anchors the chain, and how the tail node's null next is the stop signal traversal listens for. From there the cost of every supported operation follows directly: access by index is O(N) because you have to walk from the head, head insertion is O(1) because no shifting is needed, and tail insertion without a tail reference is O(N) because you have to find the end first.
Insertion and deletion are then taught as a family rather than as a list of recipes to memorise. You see five insertion variants (at the head, at the tail, after a given node, before a given node, at distance X) and seven deletion variants (first node, last node, by value, after a node, before a node, by node reference, at distance X), and how each variant decomposes into the same two-or-three pointer rewires once you know which neighbour reference you are missing.
The fundamentals close with Floyd's tortoise and hare algorithm. You walk through why two pointers moving at different speeds detect a cycle in O(N) time and O(1) space, then extend the same idea to find the cycle's entry node. This sets up a recurring theme of the rest of the course: most non-trivial singly linked list problems are solved by running two references over the list at the same time, in different ways.
Problem solving
After the fundamentals, the rest of the course is patterns. Most linked list problems you see in an interview reduce to one of seven templates, and once you can recognise the template the pointer wiring becomes the only hard part.
Each pattern is taught in three layers. An Understanding lesson walks through the technique on a problem where the pattern is obvious. An Identifying lesson teaches you the signals that tell you a new problem fits the template, the same triggers an experienced engineer reads in an interview. Then four problems give you progressively harder applications. The course closes with a design capstone where you implement a singly linked list of your own, with every supported operation written at its tightest complexity and tested against an array-backed reference implementation.
How this course is different
Most linked list resources stop at reversal and cycle detection, treating each subsequent problem as its own one-off trick. This course teaches the seven patterns underneath, so you recognise the template before you write a single pointer assignment.
Who this course is for
The course suits anyone who has heard the words "linked list" but is not yet confident they could wire one up cleanly under interview pressure.
- New programmers who can write a
forloop but have never traced whatnode = node.nextdoes to the reference under the variable. - Self-taught and bootcamp graduates who solved a few linked list problems on LeetCode but cannot recognise the patterns underneath.
- Working developers who use
ArrayListandHashMapevery day and have not written a node-based structure since school. - Engineers preparing for FAANG and Big Tech interviews where reversal, cycle detection, and merge questions appear in nearly every onsite.
- Returning engineers who learned linked lists years ago and want a refresher that goes past the textbook reversal walkthrough.
- Anyone who can sketch a linked list on a whiteboard but loses the thread when asked to swap two adjacent nodes correctly.
Continue your DSA journey
Linked lists are the gateway data structure for every other pointer-based topic in this curriculum. After this course, your next step depends on whether you want to deepen pointer skills or move into structures that sit on top of linked lists.
- Array: The contrast course. Arrays and linked lists are the two ways to lay out a sequential collection in memory: contiguous bytes versus pointer-chased nodes. Understanding both is how you can defend your data structure choice in a system design interview.
- Doubly linked list: The natural continuation. Adding a previous pointer makes several patterns simpler and unlocks new ones (LRU cache, deque, in-place reorder). The pointer hygiene you built here transfers directly, so most learners take this course right after.
- Stack: A stack backed by a linked list pushes and pops at the head, the same O(1) operation you learned in the insertion lessons. The stack course also uses traversal patterns as a setup for the previous-closest and next-closest families.
- Queue: A queue is the canonical application of a singly linked list with both head and tail references. Once you have those two pointers, enqueue and dequeue both become O(1) operations, and the standard library queue stops looking like magic.
- Graph: Adjacency lists, the standard representation for graphs, are arrays of singly linked lists. The traversal habits and pointer hygiene you build here are the same toolkit that powers BFS, DFS, and shortest path on a graph.
- Recursion: A singly linked list is itself a recursive data structure (a node is either null or a value followed by a smaller linked list). The recursion course teaches the head, tail, and multiple recursion shapes that come up when you solve list problems recursively rather than iteratively.
Frequently asked questions
for loop and pass an object into a function, you have everything you need.ArrayList or vector) when you need random access by index, when you want cache-friendly iteration, or when your inserts and deletes happen mostly at the end. In practice, modern hardware favours arrays for most workloads, so linked lists are a strong fit when you genuinely need O(1) head insertion (LRU caches, queues, undo stacks) rather than as a default container.dummy.next as the working head, and the return value is dummy.next after the work is done. Merge two sorted lists, partition a list around a value, remove the Nth from end, and reverse a segment all read substantially cleaner with a dummy head than without.