GUIDED STUDY / 16 LESSONS

Worked problems

Follow the reasoning from the prompt to the answer.

Lessons

  1. 01 / LESSON 003

    Two Sum

    The most asked coding interview question ever.

  2. 02 / LESSON 019

    Valid Parentheses

    A stack solves this in one pass.

  3. 03 / LESSON 020

    Reverse a Linked List

    Three pointers. One loop. Zero panic.

  4. 04 / LESSON 021

    Longest Substring Without Repeats

    The window that jumps when it breaks.

  5. 05 / LESSON 022

    Number of Islands

    Count the islands with one flood fill.

  6. 06 / LESSON 023

    Best Time to Buy and Sell Stock

    Buy low, sell high, in one pass.

  7. 07 / LESSON 024

    LRU Cache

    The cache every senior interview asks for.

  8. 08 / LESSON 025

    Detect a Cycle

    The tortoise and the hare finds a loop in a linked list.

  9. 09 / LESSON 026

    Maximum Subarray

    Keep it or start over.

  10. 10 / LESSON 027

    Group Anagrams

    Sort the letters, find the family.

  11. 11 / LESSON 028

    Product Except Self

    Do it without division.

  12. 12 / LESSON 029

    Merge Two Sorted Lists

    The zipper merge. Two sorted lists, zipped into one.

  13. 13 / LESSON 153

    Find the minimum ship capacity

    Four boxes, two days. Find the smallest capacity that works.

  14. 14 / LESSON 154

    Find the shortest maze path

    The shortest maze path is the first one breadth-first search finds.

  15. 15 / LESSON 161

    Count subarrays that sum to K

    Count all nonempty slices with a target sum, even with negative numbers.

  16. 16 / LESSON 162

    Schedule courses with prerequisites

    Find a valid course order with a queue, or detect a cycle.