Jaconir
Skip to lesson
medium
15 minIntern through senior

When to use. After you can name the pattern for a prompt in under a minute.

Complexity. Time Per problem — always say it out loud before you code. Space Per problem — extra memory besides the input.

Who gets asked. Pick the intern loop or the senior loop. Do not grind every prompt on day one.

Prereq. Work through Foundations, then Patterns. Graphs & DP before the senior set.

Interview practice sets

Pattern-grouped loops for 2026 screens. Prompts are original shapes — not copied contest statements, not a branded 75-list.

How to use. Name the pattern out loud, write the bound, then code. If you cannot name the pattern in a minute, open the linked lesson instead of grinding.

Intern loop. Maps, windows, lists, trees, grid BFS. This is still the new-grad screen at most companies.

Mid loop. Prefix maps, heaps, union-find, topo sort, 1D DP.

Senior loop. 2D DP, weighted graphs, two heaps, and explaining why the naive bound is wrong.

Intern / new-grad loop

About eight sessions. Language does not matter; JS or Python is enough.

  1. 1 · Hash map

    Numbers and a target. Return two indices whose values add to the target. One pass with a complement map.

    Lesson
  2. 2 · Two pointers

    Sorted numbers. Any pair that adds to a target? In-place, no extra set.

    Lesson
  3. 3 · Sliding window

    String. Longest substring with all unique characters.

    Lesson
  4. 4 · Stack

    A string of brackets. Is every opener closed by the matching closer in order?

    Lesson
  5. 5 · Linked list

    Reverse a singly linked list in one pass. Then detect a cycle with two speeds.

    Lesson
  6. 6 · Binary tree DFS

    Height of a binary tree. Then: is it height-balanced?

    Lesson
  7. 7 · BFS on a grid

    A grid of land and water. How many islands? 4-direction BFS or DFS.

    Lesson
  8. 8 · Binary search

    Sorted array, possibly rotated. Find a target index or −1. Say O(log n).

    Lesson

Mid-level loop

You already know the intern set. These are the patterns that show up after the warmup.

  1. 1 · Prefix + map

    Count subarrays whose sum equals k. Negatives allowed.

    Lesson
  2. 2 · Heap

    Streaming numbers. Return the k most frequent values. Heap of size k, not a full sort if they ask for O(n log k).

    Lesson
  3. 3 · Monotonic stack

    For each day, days until a strictly higher value. Linear time.

    Lesson
  4. 4 · Union-find

    n nodes and a stream of undirected edges. After all unions, how many components?

    Lesson
  5. 5 · Graph topo

    Directed edges as course prerequisites. Can you finish every course? Cycle means no.

    Lesson
  6. 6 · 1D DP

    Ways to climb n steps taking 1 or 2 at a time. Then: fewest coins to make amount.

    Lesson
  7. 7 · Backtracking

    All unique subsets. Then: combinations that sum to a budget with reuse.

    Lesson
  8. 8 · Greedy intervals

    Meetings as [start, end]. Maximum you can attend if you always take the earliest finish.

    Lesson

Senior stretch

Fewer prompts, higher bar: state, transition, failure cases, and a follow-up.

  1. 1 · 2D DP

    Edit distance between two strings, or unique paths in a grid with obstacles. Name the state (i, j) before you allocate the table.

    Lesson
  2. 2 · DP on trees / graphs

    Longest path in a DAG (topo then DP). Or house-robber on a binary tree (include vs skip a node).

    Lesson
  3. 3 · Dijkstra vs BFS

    Weighted grid, no negative edges. Why BFS is wrong and a heap is right. Complexity O((V+E) log V).

    Lesson
  4. 4 · Two heaps

    Running median of a stream. Invariant: max-heap size and min-heap size differ by at most one.

    Lesson
  5. 5 · Advanced window + counter

    Shortest substring that covers another string’s character multiset. Left pointer only moves forward.

    Lesson
  6. 6 · Interview hygiene

    For any of the above: state time, space, who the algorithm fails for (negatives, disconnected graphs, overflow), and one follow-up you would ask.

    Lesson

Saved in this browser. No account.