Coding & DSA interview prep
- Arrays & Hashing — The base of most coding interviews: index into arrays in constant time, and use a hash map or set to remember
- Backtracking — Build an answer one choice at a time, undo the last choice when it cannot lead anywhere, and try the next one.
- Binary Search — Halve the search space on every step: exact match, first and last position, rotated arrays and binary search o
- Bit Manipulation — Working on the binary digits of integers with AND, OR, XOR, NOT and shifts: single-bit recipes, XOR cancellati
- BST / Ordered Set — Binary search trees and the ordered sets built on them: search, insert and delete along one path, floor and ce
- Bucket Sort — Drop each value into a bucket chosen by its value, count or digit, then read the buckets in order. No two valu
- Custom Data Structures — Design a class whose every method meets a required time bound, by combining a hash map, a linked list, an arra
- Cyclic Sort — When an array holds numbers from 1 to n, each value has a home index. Swap every value home in O(n) time and O
- Data Structure Design — Build a class whose every operation meets a required cost by combining a hash map, an array, a linked list, a
- Divide and Conquer — Split a problem into smaller copies of itself, solve each copy, and combine the answers. The recurrence that d
- Dynamic Programming — Solve a problem once for each smaller version of it, store each answer, and build the full answer from the sto
- Fast & Slow Pointers — Two pointers walk the same sequence at different speeds. The gap between them finds cycles, the middle of a li
- Fibonacci DP — The simplest DP family: each answer depends on a fixed handful of earlier answers, so a loop and two or three
- Graphs — How to store a graph, and how BFS and DFS walk it: shortest paths without weights, connected pieces, cycles an
- Greedy — Make the best-looking choice at each step and never undo it. Fast and short when it is correct, and wrong in q
- Grid DP — Count paths, find the cheapest route, or measure shapes on a 2D grid by giving every cell an answer built from
- Heaps / Priority Queue — A heap gives you the smallest (or largest) item in O(1) and adds or removes items in O(log n). It is the tool
- Intervals — Problems about ranges such as meetings, bookings and time slots: merging them, finding overlaps and counting h
- Island / Matrix Traversal — Treat each grid cell as a graph node and each neighbor as an edge. Then islands, flood fill, enclosed regions,
- K-Way Merge — Merge k sorted lists, or pick items by rank across them, with a min-heap that holds one candidate per list. N
- Kadane's Algorithm — Find the contiguous subarray with the largest sum in one pass: at each element, either extend the best subarra
- Knapsack DP — Pick items under a capacity, a target sum or a budget with one table indexed by capacity. The 0/1 and unbounde
- Knowing What to Track — Pick the few numbers that let you answer the question at each step, and update them in O(1) as you scan: lette
- Linked List In-place Reversal — Reverse a linked list, or a piece of one, by turning each next pointer around as you walk, using three pointer
- Linked Lists — Pointer manipulation fundamentals: reversing, merging, finding the middle, removing the n-th node from the end
- Math & Geometry — Number theory, overflow-safe arithmetic, fast powers, primes, cross products and random sampling: the small se
- Matrix — Two-dimensional arrays: index maps, traversal orders, rotation, spiral order, sorted-matrix search, in-place u
- Matrix as Graph — Shortest paths and distances in a grid: BFS from one cell, BFS from many cells at once, counting levels as tim
- Merge Sort — Split the array in half, sort each half, merge the two sorted halves. Always O(n log n), stable, and the merge
- Minimum Spanning Tree — Connect every node of a weighted graph at the least total cost: Kruskal with Union-Find, Prim with a heap, and
- Monotonic Queue — Keep a deque of candidate indexes in sorted order so the maximum or minimum of a sliding window, or of a range
- Monotonic Stack — Find the next or previous greater or smaller element for every position in one O(n) pass, with a stack that st
- Multi-Threaded Coding — Coding problems where several threads must take turns, share data safely or wait for each other: locks, semaph
- Ordered Set — A set that stays sorted while you add and remove: O(log n) for every operation, plus the nearest-neighbor and
- Palindromic Subsequence DP — Interval DP over a string: dp[i][j] describes the piece from i to j, and matching end characters let you grow
- Prefix Sum — Store the running total of an array once, then answer any range sum by one subtraction, and count subarrays wi
- Queues — First in, first out: the structure behind breadth-first search, level-order traversal, ring buffers and the mo
- QuickSort / QuickSelect — Partition an array around a pivot so the pivot lands in its final place. Sort both sides for quicksort, or fol
- Recursion — A function solves a problem by calling itself on a smaller piece of the same problem. It is the base for tree
- Search Algorithms — The family of search methods and when each one wins: linear scan, binary search and its boundary form, exponen
- Segment Tree & Fenwick Tree — Answer range queries and change elements in O(log n) each: the segment tree for any combinable operation, lazy
- Shortest Path Algorithms — Find the cheapest route through a weighted graph: BFS for equal weights, Dijkstra for non-negative weights, Be
- Sliding Window — Solve subarray and substring problems in one pass by keeping a window of contiguous elements and updating it a
- Sorting Algorithms — How the main sorting algorithms work, what each one costs, and how to use a built-in sort with a custom key. I
- Stacks — Last in, first out: the structure behind bracket matching, expression evaluation and the monotonic stack for n
- String DP — Compare two strings prefix by prefix in a 2D table, or one string against itself, to find subsequences, edit d
- Top K Elements — Find the k largest, smallest, closest or most frequent items with a size-k heap, quickselect or frequency buck
- Topological Sort — Order the nodes of a directed acyclic graph so every edge points forward. Kahn's algorithm peels nodes with no
- Tree Traversals — Preorder, inorder, postorder and level order: how each one walks a binary tree, how to write them with recursi
- Trees — Binary trees and binary search trees: the recursive contract, the four traversal orders, BST ranges and lowest
- Tries — A tree that stores strings one character per level, so words that share a prefix share a path. Prefix lookups
- Two Heaps — A max-heap for the lower half and a min-heap for the upper half keep the median at the two roots: O(log n) to
- Two Pointers — Two indexes walk through an array, string or linked list, and each move rules out many answers at once. It oft
- Union Find — Track which items belong to the same group as edges arrive. With path compression and union by rank, find and
Start free on Cariara · Coding problems · System design studio