All guides

Step 3 of 5: Pass the coding test

Sliding Window Pattern: 5 Problems, Java + Python

Free

No payment. Just your email.

  • 13 pages
  • 5 problems
  • Python and Java

About this guide

The one pattern behind a huge share of array and string interview questions, taught as one template instead of five separate solutions. How to recognise it in ten seconds, the fixed window and the growing window with a picture of the window moving, then five fully worked problems - maximum sum of size k, longest substring without repeats, at most k distinct, shortest subarray with sum at least target, and permutation in a string - each with the brute force and its cost, the window insight, verified Python and mirrored Java, a hand trace step by step, and the complexity. Ends with the five mistakes that quietly break a window solution and a one-page revision card. 13 pages, PDF.

What you download

  • Sliding_Window_Pattern.pdf738 KB