Coding Interview
The problem patterns behind most coding interviews, with hints, solutions in Swift, Kotlin and Java, and complexity analysis.
- 01
How coding interviews work
What happens in a coding interview, what interviewers score, a six-step method from clarifying to testing, and how to recognize which pattern a problem needs, with examples in Swift, Kotlin, Java and TypeScript.
6–25 min beginner Junior & senior
- 02
Big-O notation
Estimate how fast code gets slower as data grows, spot hidden costs in Swift, Kotlin, Java and TypeScript, and talk about time and space complexity in an interview.
6–30 min beginner Junior & senior
- 03
Arrays and strings
Know what each array and string operation costs, change arrays in place safely, answer range questions with prefix sums, and build and compare strings efficiently, with problems in Swift, Kotlin, Java and TypeScript.
7–40 min beginner Junior & senior
- 04
Hash Maps
The data structure behind half of all coding interview solutions, with Two Sum, Group Anagrams and Longest Consecutive Sequence in Swift, Kotlin and Java.
9–60 min beginner Junior & senior
- 05
Two pointers
Solve array and string problems in one pass with two indices that move toward each other or in the same direction, with Valid Palindrome, Two Sum II and 3Sum in Swift, Kotlin, Java and TypeScript.
7–30 min beginner Junior & senior
- 06
Sliding window
Turn "check every subarray" into one pass by sliding a window over the data, with fixed and variable windows, Longest Substring Without Repeating Characters and Sliding Window Maximum in Swift, Kotlin, Java and TypeScript.
6–30 min intermediate Junior & senior
- 07
Stacks and queues
Use last-in-first-out stacks and first-in-first-out queues for bracket matching, undo, BFS and monotonic-stack problems, with the right types in Swift, Kotlin, Java and TypeScript.
6–35 min beginner Junior & senior
- 08
Linked lists
Reverse, merge and walk linked lists with pointer moves, dummy heads and fast/slow pointers, with Reverse Linked List, Remove Nth Node From End and cycle detection in Swift, Kotlin, Java and TypeScript.
6–30 min beginner Junior & senior
- 09
Binary search
Find things in sorted data in O(log n), write bounds that never loop forever, and use binary search on the answer, with Search Insert Position, First Bad Version and Koko Eating Bananas in Swift, Kotlin, Java and TypeScript.
7–30 min beginner Junior & senior
- 10
Trees: DFS and BFS
Traverse binary trees depth-first with recursion and stacks, and breadth-first with queues, with Maximum Depth, Validate BST, Level Order Traversal and Lowest Common Ancestor in Swift, Kotlin, Java and TypeScript.
7–30 min intermediate Junior & senior
- 11
Graphs
Model problems as graphs, explore them with BFS and DFS without visiting anything twice, find shortest paths and orderings, with Number of Islands, Rotting Oranges and Course Schedule in Swift, Kotlin, Java and TypeScript.
6–35 min intermediate Junior & senior
- 12
Heaps
Use priority queues to always get the smallest or largest element fast, with Kth Largest Element, Top K Frequent Elements, merging sorted lists and Find Median from Data Stream in Swift, Kotlin, Java and TypeScript.
6–25 min intermediate Junior & senior
- 13
Backtracking
List every subset, permutation and combination with one choose-explore-unchoose template, cut the search short with pruning, and solve Generate Parentheses and N-Queens in Swift, Kotlin, Java and TypeScript.
6–30 min intermediate Junior & senior
- 14
Dynamic programming
Turn exponential recursion into fast solutions by remembering subproblem answers, with a five-step recipe, Climbing Stairs, House Robber, Coin Change, knapsack and Edit Distance in Swift, Kotlin, Java and TypeScript.
6–30 min intermediate Junior & senior
- 15
Greedy algorithms
Solve problems by taking the best-looking step every time, learn the sort-then-choose pattern and the exchange argument that proves it works, and spot the cases where greedy fails, with problems in Swift, Kotlin, Java and TypeScript.
7–30 min intermediate Junior & senior
- 16
Intervals
Merge overlapping ranges, count the meeting rooms you need with a sweep line, keep the most non-overlapping intervals, and design a booking calendar, with problems in Swift, Kotlin, Java and TypeScript.
6–30 min intermediate Junior & senior