Arrays & Strings
Bytes vs runes, slicing without footguns, and the in-place mindset.
Practice — write these yourself
Every module ends with exercises. Write each one in the editor on its card and run it right here against the example, then copy the “Check my solution” prompt with your code into a fresh AI chat for a review. Reference solutions are behind a spoiler.
Reverse words in a string
Given s with words separated by one or more spaces and possible leading/trailing spaces, return the words in reverse order joined by a single space. " the sky is blue " → "blue is sky the". Do it without a regex.
func reverseWords(s string) string
Valid palindrome (alphanumeric only)
Return true if s reads the same forwards and backwards, considering only letters and digits and ignoring case. "A man, a plan, a canal: Panama" → true. Assume ASCII input. O(1) extra space.
func isPalindrome(s string) bool
Rotate array right by k, in place
Rotate nums to the right by k steps, modifying it in place with O(1) extra space. k may exceed len(nums). [1,2,3,4,5,6,7], k=3 → [5,6,7,1,2,3,4].
func rotate(nums []int, k int)
Set matrix zeroes
If an element in an m×n matrix is 0, set its entire row and column to 0. Do it in place with O(1) extra space (the first row and column can serve as your markers).
func setZeroes(matrix [][]int)
The part an AI chat can't give you
An LLM will happily explain a monotonic stack — and you should let it. What it won't do is decide what you learn next, remember that you got something wrong three weeks ago, or put it back in front of you today. That machinery is the course.
Think in half-open ranges [i,j); no …
Real cards from the two free modules, scheduled by the same SM-2 code the course runs. Every module's key points become cards.
Review 12 cards, then continue 14 Backtracking.
The dashboard picks the one next thing, so you never open the course and wonder what to do.
- “sorted” + “find a pair”→Two pointers
- “longest substring…”→Sliding window
- “next greater element”→Monotonic stack
- “top k” / “k closest”→Heap
- “number of ways”→DP over states
Two full indexes map the phrases you actually see in a problem to the structure or building block they imply. Browse the DSA one free →
That's 3 of 81.
The rest of Data Structures & Algorithms, all of Broader CS, and the full System Design track — including 19 case studies you run as mock interviews — plus every exercise and the spaced-repetition review, are one payment away.
Already bought it? Unlock