Swift for Coding Interviews
The Swift you need for algorithm rounds: strings, collections, data structures, patterns and ready-to-use templates.
- 01Strings3 min
How Swift strings work, how to index them fast, the everyday operations, and the performance traps that turn O(n) into O(n²).
- 02Collections2 min
Array, Dictionary, Set and tuples in Swift, sorting with closures, reduce, zip, enumerated, 2D arrays, and the Big-O of each operation.
- 03Building Blocks3 min
Swift has no built-in stack, queue, deque or heap. Here is how to write each one quickly, plus linked lists, tree nodes and graph adjacency lists.
- 04Patterns3 min
When to use two pointers, sliding window, hashing, binary search and prefix sums, with a short Swift template for each.
- 05Trees and Graphs3 min
DFS and BFS on trees, graphs and grids (recursive and iterative), topological sort and union-find, as Swift templates.
- 06Recursion and Dynamic Programming4 min
Recursion and backtracking in Swift, memoization with dictionaries and arrays, bottom-up tables, and the common DP shapes with templates.