Linked List
Learn all three types of linked list — singly, doubly and circular — then solve the interview questions asked most for each.
- 7 Lessons
- 20 Problems
- 74 Illustrations
What you will learn
- What a linked list is, and how nodes and pointers sit in memory
- The three types — singly, doubly and circular — and what each one is good at
- Why linked lists exist, and what they do better and worse than arrays
- How to build, traverse, insert into and delete from every type, in four languages
- The most asked interview questions for singly, doubly and circular lists, from reversal to LRU Cache
- Brute force, optimal and best solutions for every problem, with a dry-run simulator
Why this course
Linked lists are where pointer thinking starts. Most mistakes in linked list problems aren't about algorithms at all — they're a lost next pointer, a missing null check, or a head that should have moved. This course is built to make those mistakes visible.
It starts with what a linked list is and its three types: singly (one next pointer), doubly (prev and next) and circular (the last node points back to the first). You'll see why each exists, when to use it, and how to build, traverse, insert and delete in every type — each idea drawn as boxes and arrows, with a simulator that shows every pointer move.
Then come the interview questions, grouped by type: the singly linked list classics, the doubly linked list questions behind browser history and LRU caches, and the circular linked list questions from rotation to the Josephus game. Every problem is solved the interview way — brute force first, then the best solution — with code in four languages, its time and space cost, and a simulator.
Requirements
- Comfort writing loops, conditionals and functions in at least one language
- The Arrays course, or equivalent familiarity with indexes and two pointers
- No prior pointer experience — references are introduced from scratch
Course Contents
2. Singly linked list · interview questions
- Reverse a Linked Listcode
solutionEasy - Middle of the Linked Listcode
solutionEasy - Merge Two Sorted Listscode
solutionEasy - Remove Duplicates from Sorted Listcode
solutionEasy - Linked List Cyclecode
solutionEasy - Palindrome Linked Listcode
solutionEasy - Intersection of Two Linked Listscode
solutionEasy - Remove Nth Node From End of Listcode
solutionMedium - Swapping Nodes in a Linked Listcode
solutionMedium - Linked List Cycle IIcode
solutionMedium - Add Two Numberscode
solutionMedium - Reorder Listcode
solutionMedium
3. Doubly linked list · interview questions
4. Circular linked list · interview questions
Related courses
- StackLast-in, first-out — the structure behind call stacks, undo history, and expression parsing.6 lessons · 13 problems
- QueueFirst-in, first-out — the structure behind task scheduling and breadth-first traversal.4 lessons · 5 problems
- ArraysContiguous, indexable memory — the foundation almost every other data structure builds on.12 lessons · 16 problems
