Catalog
Follow a path, one topic at a time.
150 interactive traces. Work through each track in order - your progress is saved to your account.
Sign in to save your progress and unlock members-only lessons.
Foundations
syncing…- BASICSBeginnerContinue →FreeFoundations - Big-O NotationThe language every engineer uses to describe speed - what O(n), O(log n), and friends actually measure, and why constants stop mattering.10m
- BASICSBeginnerFreeFoundations - Logarithms for EngineersA logarithm asks 'how many times must I halve (or double)?' - the math hiding inside binary search, balanced trees, and every O(log n) promise.8m
- BASICSBeginnerMembersFoundations - Binary Numbers & Bitwise OperationsComputers count in ones and zeros - learn to read binary, meet the bitwise operators, and understand why powers of two rule memory.9m
- BASICSBeginnerMembersFoundations - Arrays & MemoryArrays live side by side in memory - which is why indexing is instant, inserting in the middle is not, and caches love them.7m
- BASICSBeginnerMembersFoundations - Recursion & the Call StackA function that calls itself sounds scary until you see the call stack - master base cases and you unlock trees, sorting, and DP.8m
- BASICSBeginnerMembersFoundations - Sets & Maps (Hash Intuition)Ask 'have I seen this before?' or 'what do I know about X?' in one step - hash sets and maps are the most-used tools in interviews.7m
- BASICSBeginnerMembersFoundations - Graphs & NetworksNodes and edges model everything from friendships to road maps - learn the vocabulary before touching graph algorithms.7m
- BASICSBeginnerMembersFoundations - Statistics Engineers Actually UseMean vs median, percentiles, and expected value - the numbers behind latency dashboards and 'why averages lie'.7m
- BASICSBeginnerMembersFoundations - Complexity Classes ComparedWatch every complexity class race real input sizes - and learn where the practical limits of computing actually sit.7m
- BASICSBeginnerMembersFoundations - Reading Code Traces on This SiteLearn to read the variable-table trace format used across this platform - pointers, highlights, and invariants in five minutes.6m
Patterns
syncing…- PTRNBeginnerContinue →FreePattern - Two PointersOne array, two indices, O(n). The pattern behind Two Sum II, Valid Palindrome, Container With Most Water, and 3Sum.8m
- PTRNIntermediateFreePattern - Sliding WindowGrow a window right, shrink it left - O(n) instead of O(n^2). The pattern behind Longest Substring Without Repeating Characters and Minimum Window Substring.9m
- PTRNBeginnerMembersPattern - Fast & Slow PointersFloyd's tortoise and hare - detect linked-list cycles and find midpoints with O(1) space. Behind Linked List Cycle, Middle of List, and Happy Number.7m
- PTRNBeginnerMembersPattern - Prefix SumPrecompute running totals so any range sum is one subtraction. The pattern behind Range Sum Query, Subarray Sum Equals K, and Product Except Self.7m
- PTRNBeginnerMembersPattern - Hash Map for LookupsTrade memory for instant answers: have I seen this before? How many times? Where? Behind Two Sum, Contains Duplicate, Group Anagrams, and First Unique Character.7m
- PTRNIntermediateMembersPattern - Binary Search on the AnswerWhen brute-forcing the answer space is monotonic, binary search THE ANSWER itself. Behind Capacity to Ship Packages, Koko Eating Bananas, and Split Array Largest Sum.9m
- PTRNIntermediateMembersPattern - BFS & DFS TraversalTwo templates that visit every reachable node: BFS spreads level by level (shortest paths), DFS dives deep (structure and connectivity). Behind Number of Islands, Clone Graph, Word Ladder, Rotting Oranges.10m
- PTRNIntermediateMembersPattern - BacktrackingSystematically build candidates, undo dead ends, enumerate everything. Behind Subsets, Permutations, Combination Sum, N-Queens, and Word Search.9m
- PTRNIntermediateMembersPattern - Topological Sort (Kahn's Algorithm)Order tasks when prerequisites block them: repeatedly take nodes with zero unfinished dependencies. Behind Course Schedule II, Build Order, and Alien Dictionary.8m
- PTRNIntermediateMembersPattern - Monotonic StackNext greater/smaller element for everyone in O(n): keep the stack sorted by only popping smaller items. Behind Daily Temperatures, Next Greater Element, Largest Rectangle, and Trapping Rain Water.8m
- PTRNIntermediateMembersPattern - Dynamic Programming FrameworkStop memorizing DP problems. Define a state, write the transition, memoize or tabulate. Behind Climbing Stairs, House Robber, Coin Change, LIS, and Edit Distance.10m
- PTRNIntermediateMembersPattern - Heaps & Top-KKeep only the best K candidates in a size-K heap instead of sorting everything. Behind Top K Frequent, Kth Largest, K Closest Points, and Find Median from Data Stream.8m
- PTRNIntermediateMembersPattern - Intervals & GreedySort intervals, sweep once, decide locally. Behind Meeting Rooms, Merge/Insert Interval, Non-overlapping Intervals, and Interval Scheduling.8m
- PTRNIntermediateMembersPattern - Bit Manipulation TricksXOR cancels duplicates, n & (n-1) drops the lowest set bit, shifts multiply by two. Behind Single Number, Number of 1 Bits, Counting Bits, and Missing Number.8m
Data Structures
syncing…- DSBeginnerContinue →FreeLinked List - Insert at HeadO(1) insertion. Allocate a node, rewire next, and move the head pointer.5m
- DSIntermediateFreeLRU CacheHash map for O(1) lookup plus a doubly linked list for recency order. Least-recently-used evicts first.9m
- DSBeginnerMembersValid ParenthesesCheck that every bracket is closed in the right order using a stack.6m
- DSBeginnerMembersMerge Two Sorted ListsMerge two sorted lists into one by always taking the smaller next node.7m
- DSBeginnerMembersReverse Linked ListReverse a linked list in place by rewiring each node's next pointer with three pointers.7m
- DSBeginnerMembersMaximum Depth of Binary TreeFind how deep a binary tree goes by computing subtree heights bottom-up.6m
- DSBeginnerMembersInvert Binary TreeMirror a binary tree by swapping each node's left and right children.6m
- DSIntermediateMembersValidate Binary Search TreeCheck a BST's ordering with an in-order walk or a value range.8m
- DSIntermediateMembersBinary Tree Level Order TraversalVisit a tree row by row using a queue - breadth-first search.7m
- DSBeginnerMembersLinked List CycleDetect a cycle in a linked list with Floyd's slow and fast pointers.7m
- DSAdvancedMembersBinary Tree Maximum Path SumFind the largest sum of any path in a binary tree with a post-order gain function.10m
- DSIntermediateMembersLowest Common Ancestor of a BSTFind the deepest node that has both targets as descendants using the BST order.8m
- DSAdvancedMembersSerialize and Deserialize Binary TreeEncode a tree to a string and rebuild it exactly, using pre-order with null markers.10m
- DSBeginnerMembersSame TreeCheck whether two binary trees are identical with a parallel recursive walk.6m
- DSIntermediateMembersData Structure - Heap & Priority QueueA binary heap gives O(1) access to the min/max and O(log n) insert - the engine behind top-k, schedulers, and Dijkstra.9m
- DSIntermediateMembersData Structure - Trie (Prefix Tree)Store words character by character so prefix lookups cost O(length), not O(dictionary size) - the engine of autocomplete.8m
Algorithms
syncing…- ALGOIntermediateContinue →MembersConstruct Binary Tree from Preorder and Inorder TraversalPreorder's first element is always the root; an index map into inorder splits left/right subtrees in O(n).9m
- ALGOAdvancedMembersWord Search IIFind ALL dictionary words hidden in a grid: build a Trie of words, DFS once from every cell walking the Trie simultaneously.10m
- ALGOIntermediateMembersAdd and Search Word (Trie with wildcards)Trie supporting exact adds plus '.'-wildcard searches: same children map, but wildcard branches fan out via recursion.8m
- ALGOIntermediateMembersRotting OrangesMinutes until all oranges rot: multi-source BFS seeded with every rotten orange, spreading level by level.8m
- ALGOIntermediateMembersSum of Two IntegersAddition without '+' or '-': XOR adds carry-less, AND<<1 computes carries; iterate until no carry remains.7m
- ALGOBeginnerMembersMajority ElementFind the element appearing more than n/2 times in O(n) time and O(1) space with Boyer-Moore voting.6m
- ALGOIntermediateMembersReverse BitsMirror a 32-bit integer: peel bits off one end with shifts/masks and push them onto the other.7m
- ALGOIntermediateMembersSort Colors (Dutch National Flag)One pass, three pointers, zero swaps beyond necessity: the Dutch National Flag partition from Dijkstra.7m
- ALGOBeginnerMembersMove ZeroesShift all zeros to the end in place while preserving order: chasing-pointer write compaction.6m
- ALGOIntermediateMembersGraph Valid Treen nodes with exactly n-1 edges and full connectivity = tree. Union-Find detects cycles in near-O(n).7m
- ALGOIntermediateMembersNumber of Connected ComponentsCount disjoint friend circles in an undirected graph - Union-Find merging or BFS from every unvisited node.8m
- ALGOIntermediateMembersWord SearchDoes the grid contain a word via adjacent cells? DFS backtracking with in-place visited marking.8m
- ALGOIntermediateMembersPacific Atlantic Water FlowCells that drain to both oceans: reverse the flow - BFS/DFS inward FROM each ocean coast and intersect reach sets.9m
- ALGOIntermediateMembersKth Smallest Element in a BSTIn-order traversal of a BST visits values ascending - stop at the kth visit. O(h) with early exit via an iterator pattern.7m
- ALGOIntermediateMembersDesign HashMapBuild a hash map from scratch: fixed bucket array + chaining, with a hash function and load-factor resizing.8m
- ALGOIntermediateMembersSpiral MatrixTraverse an m x n matrix in spiral order with four shrinking boundaries - top, bottom, left, right.8m
- ALGOIntermediateMembersEncode and Decode StringsSerialize a list of strings into one string and back: length-prefix encoding survives any character content.7m
- ALGOIntermediateMembersLongest Palindromic SubstringExpand around each of the 2n-1 centers - simpler than DP tables and faster than Manacher for interviews.9m
- ALGOAdvancedMembersTrapping Rain WaterWater above bar i = min(maxLeft, maxRight) - height[i]. Two pointers compute it in one pass with O(1) space.10m
- ALGOIntermediateMembersMinimum Window SubstringSmallest substring of s containing every char of t (with repeats): sliding window + need/have counters.10m
- ALGOIntermediateMembersLongest Repeating Character ReplacementLongest window after flipping at most k chars: validity is (window length - max frequency) <= k.8m
- ALGOIntermediateMembersJump GameCan you reach the last index? Track the farthest reachable index greedily - no DP table needed.7m
- ALGOIntermediateMembersMaximum Product SubarrayProducts break standard Kadane: negatives flip sign and zeros reset - so track BOTH best and worst running products.8m
- ALGOIntermediateMembersLongest Common SubsequenceThe 2-D DP archetype: dp[i][j] over two strings, match-or-skip transitions. Gateway to Edit Distance and diff tools.9m
- ALGOIntermediateMembersHouse Robber IIHouses on a circle - first neighbors last. The trick: run linear House Robber twice, excluding one end each time.8m
- ALGOIntermediateMembersRemove Nth Node From End of ListOne pass with a lead gap: fast pointer runs n ahead, then both walk - slow stops exactly before the doomed node.7m
- ALGOIntermediateMembersReorder ListL0 -> Ln -> L1 -> Ln-1 in place: find middle, reverse second half, interleave. Three classic techniques in one problem.8m
- ALGOIntermediateMembersTask SchedulerCPU cooldowns between identical tasks: the answer hides in the most frequent task's frame, not in simulating.9m
- ALGOIntermediateMembersK Closest Points to OriginTop-K over distances without computing square roots: max-heap of size k on squared distance, or quickselect.7m
- ALGOAdvancedMembersMerge K Sorted Listsk-way merge with a size-k min-heap of list heads - always pop the global minimum. O(N log k).9m
- ALGOAdvancedMembersFind Median from Data StreamTwo balanced heaps partition the stream: max-heap below, min-heap above. Median reads off the roots in O(1).9m
- ALGOIntermediateMembersClone GraphDeep-copy a cyclic graph without infinite loops: a visited map turns cycles into plain memoized recursion.8m
- ALGOIntermediateMembersNon-overlapping IntervalsMinimum removals so intervals stop colliding: sort by end time, greedily keep earliest finishers.8m
- ALGOIntermediateMembersMin Stackpush/pop/min all O(1): cache the minimum at every stack depth so pops restore it automatically.7m
- ALGOIntermediateMembersKth Largest Element in an ArrayThree tiers: sort O(n log n), heap O(n log k), and quickselect O(n) average - know all three and their trade-offs.8m
- ALGOIntermediateMembersSearch in Rotated Sorted ArrayBinary search on a sorted array rotated at an unknown pivot - always land on the sorted half.9m
- ALGOIntermediateMembersContainer With Most WaterTwo lines, most water: converging pointers with a proof that discarding the shorter side is always safe.8m
- ALGOIntermediateMembersLongest Increasing SubsequenceO(n^2) DP with state dp[i] = LIS ending at i - then upgrade to O(n log n) with patience sorting on tails.9m
- ALGOIntermediateMembersCombination SumUnlimited coin reuse, enumerate every unique combo: backtracking with a start index and prune-on-overshoot.9m
- ALGOIntermediateMembersUnique PathsRobot walks m x n grid moving only right/down: 2-D DP where each cell inherits from top and left. Gateway to all grid DP.8m
- ALGOBeginnerFreeBinary SearchHalve the search space every step. Trace low, mid, and high as they converge on the target.6m
- ALGOBeginnerMembersBubble SortThe largest unsorted value bubbles to the end of each pass. Watch swaps happen in place.8m
- ALGOBeginnerFreeTwo SumFind two numbers that add up to a target. The single most-asked interview question.6m
- ALGOBeginnerMembersValid PalindromeCheck whether a string reads the same forward and backward with two pointers.5m
- ALGOBeginnerMembersValid AnagramDecide whether two strings are the same letters rearranged, by counting characters.5m
- ALGOBeginnerMembersContains DuplicateDetect whether an array has any repeated value using a hash set.4m
- ALGOBeginnerMembersBest Time to Buy and Sell StockFind the maximum profit from one buy and one sell by tracking the lowest price seen so far.6m
- ALGOIntermediateMembersMaximum SubarrayFind the contiguous subarray with the largest sum using Kadane's algorithm.8m
- ALGOIntermediateMembersNumber of IslandsCount connected land regions in a grid with a flood-fill DFS.9m
- ALGOBeginnerMembersClimbing StairsCount ways to climb n stairs taking 1 or 2 steps - the Fibonacci recurrence.7m
- ALGOIntermediateMembersHouse RobberMax money you can rob from a row of houses without hitting adjacent ones.8m
- ALGOIntermediateMembers3SumFind all triplets that sum to zero using sort plus two pointers.10m
- ALGOIntermediateMembersProduct of Array Except SelfReturn the product of every element except the current one, without division.8m
- ALGOIntermediateMembersCoin ChangeFind the fewest coins that make a target amount with unbounded denominations.10m
- ALGOIntermediateMembersGroup AnagramsGroup words that are anagrams using a sorted string as the key.8m
- ALGOIntermediateMembersLongest Substring Without Repeating CharactersFind the longest substring with all distinct characters using a sliding window.8m
- ALGOIntermediateMembersTop K Frequent ElementsReturn the k most common values using bucket sort by frequency.8m
- ALGOIntermediateMembersWord BreakDecide if a string can be split into dictionary words with DP.10m
- ALGOIntermediateMembersDecode WaysCount how many ways a digit string can decode into letters with a Fibonacci-style DP.9m
- ALGOIntermediateMembersCourse ScheduleDecide if all courses can be taken by detecting a cycle with Kahn's topological sort.10m
- ALGOBeginnerMembersNumber of 1 BitsCount set bits in an integer by clearing the lowest 1 with n & (n - 1).6m
- ALGOBeginnerMembersMissing NumberFind the missing number from 0..n using the sum formula or XOR.6m
- ALGOIntermediateMembersRotate ImageRotate an n x n matrix 90 degrees clockwise in place via transpose and reverse.8m
- ALGOIntermediateMembersMerge IntervalsMerge overlapping intervals by sorting on start, then fusing overlaps in one pass.8m
- ALGOIntermediateMembersInsert IntervalInsert a new interval into a sorted non-overlapping list and merge any overlaps.8m
- ALGOBeginnerMembersMeeting RoomsDecide if one person can attend all meetings by checking sorted intervals for overlaps.6m
- ALGOIntermediateMembersAlgorithm - Union-Find (Disjoint Set Union)Track which items belong to the same group in near-constant time - the secret weapon behind cycle detection and connected components.8m
- ALGOAdvancedMembersAlgorithm - Dijkstra's Shortest PathGreedy + priority queue settles the closest unfinalized node each round - shortest paths for any graph with non-negative weights.10m
- ALGOBeginnerMembersAlgorithm - Merge SortDivide in half, sort recursively, merge linearly - the stable O(n log n) guarantee and the gateway to external sorting.7m
- ALGOBeginnerMembersAlgorithm - Quick SortPartition around a pivot and recurse - the fastest in-memory sort in practice, with an O(n²) worst case you must know how to avoid.8m
System Design
syncing…- SYSAdvancedContinue →MembersConsistent HashingDistribute keys across servers so adding or removing a node moves only ~1/n of keys - the backbone of sharding.10m
- SYSAdvancedMembersTypeahead / Search SuggestionsInstant suggestions as you type: precomputed top-K per prefix served from RAM, refreshed asynchronously from search logs.10m
- SYSAdvancedMembersVideo Streaming Service (YouTube/Netflix)Upload pipeline transcodes into multi-bitrate chunks; CDN edge servers stream via adaptive bitrate (HLS/DASH).12m
- SYSAdvancedMembersRide-Sharing Service (Uber/Lyft)Geospatial matching at scale: geohash grid buckets for driver discovery, websocket presence, and state-machine trips.11m
- SYSAdvancedMembersDistributed File Storage (Google Drive/Dropbox)Chunk files into 4MB blocks, dedupe by content hash, sync via metadata-only delta uploads - block storage beats file storage.11m
- SYSAdvancedMembersTicket Booking System (Ticketmaster)Scarcity under thundering herds: virtual waiting rooms, seat holds with TTLs, and atomic inventory commits.10m
- SYSAdvancedMembersPhoto Sharing Service (Instagram Feed)Media pipeline + fan-out-on-write for normal users and fan-out-on-read for celebrities - the hybrid feed classic.10m
- SYSAdvancedMembersSearch Index (Inverted Index)Map words -> document lists, shard across machines, merge ranked results - how Elasticsearch/web search actually work.10m
- SYSIntermediateFreeSystem Design - URL ShortenerA short URL service end to end: short-code generation, storage, caching, and redirects.7m
- SYSBeginnerMembersSystem Design - How DNS WorksTurn a name into an IP: recursive resolution from the resolver to the root, TLD, and authoritative servers.6m
- SYSIntermediateFreeSystem Design - CachingServe hot data from memory and pick the write strategy that matches your risk tolerance.9m
- SYSIntermediateMembersSystem Design - CAP TheoremA distributed system can guarantee only two of three: consistency, availability, and partition tolerance.7m
- SYSIntermediateMembersSystem Design - SQL vs NoSQLPick the store that fits the data shape: relational for joins and ACID, NoSQL for scale and flexibility.8m
- SYSAdvancedMembersSystem Design - Scaling to Millions on AWSGrow a system from one box to millions of users by removing the bottleneck at each step.12m
- SYSAdvancedMembersSystem Design - Twitter Timeline and SearchPost a tweet, fan it out to follower timelines, serve reads from cache, and search an index.12m
- SYSIntermediateMembersSystem Design - Content Delivery NetworkServe content from servers near the user so it loads fast anywhere in the world.8m
- SYSIntermediateMembersSystem Design - Load BalancerSpread traffic across servers so no single machine is overwhelmed, and hide failures.8m
- SYSIntermediateMembersSystem Design - Reverse ProxyA server that sits in front of your backend, forwards requests, and shields it from clients.7m
- SYSIntermediateMembersSystem Design - Application Layer and MicroservicesSplit an app into small independent services, each owning one job and its own data.9m
- SYSAdvancedMembersSystem Design - Database ScalingKeep the database fast as it grows: replication, federation, sharding, and denormalization.11m
- SYSIntermediateMembersSystem Design - Consistency PatternsWeak, eventual, or strong: how fresh a read is, and what you pay for it.8m
- SYSIntermediateMembersSystem Design - Availability PatternsFailover and replication keep a system up - and the nines measure how well.8m
- SYSIntermediateMembersSystem Design - Asynchronism and QueuesDo slow work later, off the request path, so the user is never kept waiting.8m
- SYSIntermediateMembersSystem Design - Communication ProtocolsHow services talk: TCP vs UDP underneath, and RPC vs REST on top.9m
- SYSIntermediateMembersSystem Design - Security and TLSTLS encrypts traffic end to end: a handshake exchanges keys, then symmetric crypto seals the stream.7m
- SYSAdvancedMembersSystem Design - Web CrawlerDownload the web page by page: a frontier queue, polite fetching, dedup, and an index.12m
- SYSIntermediateMembersSystem Design - Personal Finance AggregatorPull transactions from many banks, normalize them, and categorize spending.10m
- SYSAdvancedMembersSystem Design - Social GraphModel users and follows as a graph, then traverse it for suggestions and feeds.10m
- SYSAdvancedMembersSystem Design - Key-Value StoreConsistent hashing maps keys to shards so adding a node moves few keys, with quorums for consistency.11m
- SYSAdvancedMembersSystem Design - Sales RankingTurn a stream of orders into a live bestseller list with incremental counters and a top-N computation.10m
- SYSIntermediateMembersOO Design - Parking LotModel a parking lot: levels, spots, vehicles, and tickets, with O(1) spot lookup.9m
- SYSBeginnerMembersOO Design - Deck of CardsModel cards, a deck, hands, and a game - and shuffle correctly with Fisher-Yates.7m
- SYSIntermediateMembersOO Design - Call CenterRoute calls to the first available employee, then escalate up the chain of command.8m
- SYSAdvancedMembersOO Design - Online ChatModel users, conversations, and messages, with fan-out delivery and presence tracking.9m
- SYSIntermediateMembersSystem Design - Back-of-Envelope EstimationEstimate QPS, storage, and latency in your head to sanity-check any design before building.8m
- SYSIntermediateMembersSystem Design - Rate LimiterReject excess traffic with counters and windows - fixed, sliding, and token-bucket strategies compared.9m
- SYSIntermediateMembersSystem Design - Distributed Message QueueDecouple producers from consumers with a durable log - offsets, delivery guarantees, and ordering trade-offs.10m
- SYSIntermediateMembersSystem Design - Proximity Service (Geo-Indexing)Find everything nearby at city scale - geohash grids, cell rings, and the write-heavy reality of moving objects.10m
- SYSAdvancedMembersSystem Design - Undo/Redo & Collaborative EditingCommand stacks for solo undo, then OT and CRDT strategies when many cursors edit one document at once.10m
- SYSIntermediateMembersSystem Design - Notification SystemFan one event out to millions across push, email, and in-app - with preferences, dedupe, and rate caps at every hop.9m