Loading video player…

Welcome to Linked Lists and Trees

In this course, you’ll practice the problems where data points to other data: linked lists, where each node knows the next one, and trees, where a node can have many children. They’re interview favorites because a small slip with a reference breaks everything, and because the same skills carry over to the DOM, nested JSON, and every other tree you work with in JavaScript.

What You’ll Practice

  • Linked lists: walk a list node by node, relink it in place without losing any nodes, and send two runners at different speeds to find a middle or a loop
  • Recursion: solve a problem by trusting a smaller call, and know when the call stack is about to run out
  • Trees: let each subtree report back a count, a depth, or a verdict, and process a tree row by row when the question is about levels

You’ll also run into JavaScript details that interviewers like to probe:

  • Why two objects with the same data aren’t ===
  • Why null and undefined aren’t interchangeable at the end of a list
  • Why a deep tree makes a recursive function throw a RangeError
  • Why shift() gets slow on a large queue
  • Why { ...node } copies only the top level

How the Course Works

  • Concept lessons introduce linked lists, recursion, and trees with short examples you can run.
  • Exercises run in your browser on Node 26, and you don’t need to install anything. Each problem is set in a web-app scenario. Get a working solution first. Then a bonus test plays the interviewer’s follow-up: does your solution still work when the list gets long or the tree gets deep or wide?
  • An AI-code review hands you a plausible function with hidden bugs. Your job is to find them and fix it, which is the skill you need whenever an assistant writes code for you.
  • Recaps at the end of each section let Mentor AI look at your attempts and talk through whatever hasn’t clicked yet.
  • Mixed Practice ends the course with problems that combine both structures, a quiz on choosing the right pattern, and a mock interview.

Before You Start

You should be comfortable writing JavaScript functions and working with objects, arrays, and loops. Knowing what O(n) and O(n²) mean helps.

The earlier courses in this path practice those costs on arrays and strings, and the stacks and queues from the third course come back here when you walk a tree without recursion. You don’t need to finish those courses first, though. When a problem gets tangled, grab a pen and draw the boxes and arrows. Interviewers like to see that, too.

Your Cheat Sheets

Two cheat sheets go with every course in this learning path. Keep them open while you practice. The patterns sheet shows how to spot each interview pattern, with a JavaScript template for it, and the complexity sheet lists what common JavaScript operations cost in time and space.

Become a Member to join the conversation.