Back to library

πŸ”—Linked Lists from Scratch

Stop memorizing linked-list operations as recipes. Build the pointer intuition that lets you draw any node-and-arrow problem on a whiteboard and solve five classic interview questions without losing your place mid-traversal.

Foundations14 drops~2-week path Β· 5–8 min/daytechnology

Phase 1Why Linked Lists Trade Layout for Flexibility

See why linked lists trade memory layout for pointer flexibility

4 drops
  1. A linked list is a treasure hunt, not a row of lockers

    6 min

    A linked list is a treasure hunt, not a row of lockers

  2. A node is a value with a forwarding address

    5 min

    A node is a value with a forwarding address

  3. Walking the chain is the only way to see what's there

    6 min

    Walking the chain is the only way to see what's there

  4. Every operation must leave the chain unbroken

    7 min

    Every operation must leave the chain unbroken

Phase 2Coding Insert, Delete, and Reverse Without Breaking Pointers

Code insert, delete, and reverse without breaking pointers

5 drops
  1. Inserting at the front is two pointer moves and a coffee

    5 min

    Inserting at the front is two pointer moves and a coffee

  2. To insert in the middle, walk to the node before

    7 min

    To insert in the middle, walk to the node before

  3. Delete is just rerouting around the dead node

    7 min

    Delete is just rerouting around the dead node

  4. Reverse a list with three pointers and one loop

    8 min

    Reverse a list with three pointers and one loop

  5. A dummy head removes every special case

    6 min

    A dummy head removes every special case

Phase 3Singly, Doubly, and Circular β€” Choose by Problem Shape

Pick singly, doubly, or circular by problem shape

4 drops
  1. Two pointers per node, twice the freedom of movement

    6 min

    Two pointers per node, twice the freedom of movement

  2. When the tail points back to the head, the list has no end

    6 min

    When the tail points back to the head, the list has no end

  3. Pick the linked-list variant by reading the problem out loud

    6 min

    Pick the linked-list variant by reading the problem out loud

  4. Two pointers, different speeds β€” that's how you catch a cycle

    7 min

    Two pointers, different speeds β€” that's how you catch a cycle

Phase 4Solve Five Classic Linked-List Interview Problems by Hand

Solve five classic linked-list interview problems by hand

1 drop
  1. Walk through five classic linked-list problems on paper

    22 min

    Walk through five classic linked-list problems on paper

Frequently asked questions

What's the difference between an array and a linked list?
This is covered in the β€œLinked Lists from Scratch” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Why do linked lists make insertion fast but lookup slow?
This is covered in the β€œLinked Lists from Scratch” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How do I reverse a linked list in place without losing pointers?
This is covered in the β€œLinked Lists from Scratch” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
When should I use a doubly linked list instead of a singly linked list?
This is covered in the β€œLinked Lists from Scratch” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How does Floyd's tortoise and hare detect a cycle in a linked list?
This is covered in the β€œLinked Lists from Scratch” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.