// request flow
Request Flows
Step through the route a request takes across services, protocols, and runtime layers.
- 01algorithmsC++ Memory LayoutVisual map of C++ memory segments: text (code), data (globals), heap (dynamic), and stack (locals).5 stagesSep 26, 2026
- 02networkingNetwork Layers in a RequestVisualize the four network layers (application, transport, network, link, physical) and how each adds a header as a request travels to a server.5 stagesSep 26, 2026
- 03operating systemsProcess vs Thread at a GlanceVisual comparison of processes and threads: memory isolation, creation cost, communication, and failure boundaries.5 stagesSep 26, 2026
- 04system designA Browser Request Reaches a ServerFollow a request from the browser through name resolution, transport, TLS, and HTTP to the application — the first mile of every system design.5 stagesSep 26, 2026
- 05system designMulti-Region Active-Passive ArchitectureVisualize a primary region handling all traffic, a passive backup region ready to take over, and the failover path when the primary becomes unhealthy.5 stagesSep 26, 2026
- 06system designRate Limiting with a Token BucketVisualize how a token bucket limits request rate, handles bursts, and enforces a steady throughput ceiling.5 stagesSep 26, 2026
- 07algorithmsArray Indexing Against Linked List WalkingFollow one read at position 3 through contiguous slots and pointer hops to see why layout decides speed.5 stagesSep 25, 2026
- 08algorithmsCounting Steps From a 4-by-4 Grid to Big-OCount 16 runs in nested loops, watch a halving loop shrink, and separate worst case from average and amortized cost.5 stagesSep 25, 2026
- 09algorithmsBreadth-First Search in Queue OrderWalk four vertices from source 0 in rings, mark at enqueue time, and record fewest-edge distances.5 stagesSep 25, 2026
- 10algorithmsA Hash Lookup From Key to Verified ValueHash amy to slot 5, collide with bob, probe to slot 6, and see why load factor forces an early resize.5 stagesSep 25, 2026
- 11algorithmsScan Once or Sort Once, Then SearchFind 8 in a five-element array by scan and by binary search, and learn when each plan wins.5 stagesSep 25, 2026
- 12algorithmsHeap for the Top, Tree for Any KeyPush 1 onto a heap and find 4 in a search tree to feel single-path repair and comparison-guided search.5 stagesSep 25, 2026
- 13databasesFind the Data Access That Dominates Query CostDatabase performance depends on how many rows and pages a query touches, how much data moves between operators, and whether the working set fits in memory. An index-only scan can avoid table lookups when the requested columns are present and visibility information permits it.5 stagesSep 25, 2026
- 14databasesA B-Tree Index Narrows a Database SearchA database index is an auxiliary structure that helps find rows without scanning every table page. For a query filtering by customer_id and ordering by created_at, a composite index beginning with customer_id may narrow to one customer’s key range and then return rows in order.5 stagesSep 25, 2026
- 15databasesReading a Query Plan as an Execution HypothesisA query planner estimates alternative ways to produce a result and chooses one using statistics and cost assumptions. In a nested-loop join, the inner plan may run once for each outer row; that is attractive when the outer side is small and the inner side has an index.5 stagesSep 25, 2026
- 16databasesReplication Improves Availability at a Consistency CostReplication stores copies of data on multiple machines to improve availability, read capacity, or recovery. With asynchronous replication, a write can be acknowledged by the leader before a follower receives it, so an immediate read from that follower may return an older value.5 stagesSep 25, 2026
- 17databasesTransactions, Isolation, and MVCC SnapshotsA transaction groups operations under a database contract such as atomicity and consistency. Under snapshot-based isolation, a transaction may read a row version that was committed when its snapshot began, even if another transaction later updates the row.5 stagesSep 25, 2026
- 18networkingAn API Request's JourneyFollow an HTTPS request from browser to service and watch its response return through the same system.8 stagesSep 25, 2026
- 19networkingDesigning APIs Around Explicit SemanticsAn API contract defines the meaning of operations, inputs, outputs, errors, and side effects. A PUT that replaces a resource can be retried safely when the same request produces the same target state.5 stagesSep 25, 2026
- 20networkingTreat Browser Input as Data at Every BoundaryBrowser security depends on keeping untrusted data from becoming executable code or changing the meaning of a command. If a comment is stored and later placed into a page, escaping it for the correct HTML context prevents markup from becoming active.5 stagesSep 25, 2026
- 21networkingCaching and Routing Change the Request PathA cache stores reusable results near the request path to reduce repeated work or latency. A cache-aside flow checks the cache, loads from the source on a miss, then stores the result with an expiry.5 stagesSep 25, 2026
- 22networkingDNS Resolution Is a Chain of Cached QuestionsDNS maps names to typed records through a distributed hierarchy. For a hostname, the answer can involve a CNAME alias followed by address records.5 stagesSep 25, 2026
- 23networkingAuthentication, Sessions, and AuthorizationAuthentication answers who or what is making a request; authorization decides which actions that identity may perform on a resource. After login, a server can create a random session identifier and store session state server-side, sending the identifier in a protected cookie.5 stagesSep 25, 2026
- 24networkingStore Password Verifiers, Not Recoverable PasswordsPassword storage should make a stolen database expensive to search. At registration, the service generates a salt and computes a verifier using a password-hashing algorithm with a configured cost.5 stagesSep 25, 2026
- 25networkingTCP Provides an Ordered Byte StreamTCP provides applications with a reliable, ordered byte stream over an IP network. A sender can write a short buffer, but TCP may combine it with other data or split it across segments.5 stagesSep 25, 2026
- 26networkingThreat Modeling Starts With Assets and BoundariesThreat modeling is a structured way to ask how a system could be misused or attacked. A diagram of a file upload can show the browser, API, object store, and image-processing worker.5 stagesSep 25, 2026
- 27networkingTLS Establishes Keys and Authenticates a PeerTLS protects an application connection by negotiating cryptographic parameters, establishing shared traffic keys, and authenticating a server certificate under a trust policy. The client validates that the presented certificate chains to a trusted authority, is valid for the requested hostname, and satisfies local.5 stagesSep 25, 2026
- 28operating systemsBranch Prediction and Exposing Parallel WorkBranches make program control depend on data. A loop over sorted values may have a highly predictable branch, while a branch on randomized values may be difficult to predict.5 stagesSep 25, 2026
- 29operating systemsA Bytecode VM Executes a Portable Instruction SetBytecode is a compact instruction representation designed for a virtual machine rather than one physical processor. A stack-based instruction sequence might push two constants, add the top values, and return the result.5 stagesSep 25, 2026
- 30operating systemsWhy Memory Locality MattersProcessors use a hierarchy of storage because small, nearby storage can be accessed faster than large, distant storage. A row-major matrix traversal that increments the inner column index typically consumes adjacent elements, while stepping through a column may jump by an entire row stride.5 stagesSep 25, 2026
- 31operating systemsFrom Source Files to a Running ProgramA build turns source text and dependencies into an executable representation through distinct stages. If module A calls a function defined in module B, A’s object file can contain a symbol reference that the linker resolves.5 stagesSep 25, 2026
- 32operating systemsSynchronization Makes Shared State PredictableConcurrency means operations overlap in time; it does not require multiple CPU cores. A mutex can protect a critical section so only one thread updates an invariant at a time.5 stagesSep 25, 2026
- 33operating systemsBits Become ValuesMemory stores bit patterns; a type and an operation determine how a program interprets those bits. An unsigned w-bit integer represents values from zero through 2^w minus one.5 stagesSep 25, 2026
- 34operating systemsAsync Code Still Runs on an Event LoopAn event loop repeatedly selects ready work and runs callbacks or tasks. When a Node.js handler starts a network request, the runtime registers work with the operating system or an internal pool.5 stagesSep 25, 2026
- 35operating systemsWhat a Function Call Places in a Stack FrameA function call transfers control while preserving enough state for the caller to resume. When function A calls B, the machine records a return location and passes arguments according to the platform ABI.5 stagesSep 25, 2026
- 36operating systemsHeap Allocation and Garbage CollectionThe heap holds objects whose lifetimes are not tied to one simple lexical scope. A tracing collector starts from roots such as active stacks and global references, follows pointers, and marks reachable objects.5 stagesSep 25, 2026
- 37operating systemsInstruction Pipelines and Dependency HazardsA processor pipeline overlaps stages of multiple instructions, much like an assembly line. If instruction B needs a value that instruction A has not produced yet, B has a data dependency.5 stagesSep 25, 2026
- 38operating systemsWhen a Runtime Compiles Hot CodeA just-in-time compiler translates code while a program runs. If a function repeatedly receives integers, a JIT may generate a fast integer path guarded by a type check.5 stagesSep 25, 2026
- 39operating systemsA Parser Turns Tokens Into StructureA lexer groups characters into tokens such as identifiers, numbers, and punctuation. For the expression 2 + 3 * 4, a precedence-aware parser constructs multiplication beneath addition so evaluation yields 14.5 stagesSep 25, 2026
- 40operating systemsA Process Is More Than a Program FileA program file is a persistent description of code and data; a process is a running instance with execution state and an address space. At launch, the loader maps executable code and data, creates a stack, prepares arguments and environment, and arranges runtime initialization.5 stagesSep 25, 2026
- 41operating systemsProcesses, Threads, and the Cost of SharingA process is a protected resource container with an address space and operating-system-managed resources. When a thread blocks on I/O, the scheduler may run another runnable thread.5 stagesSep 25, 2026
- 42operating systemsProfile Before Rewriting the Slow PathProfiling attributes resource use to parts of a running program; benchmarking compares defined workloads under controlled conditions. If a CPU profile shows most samples inside JSON parsing, tuning database indexes will not fix the measured CPU bottleneck.5 stagesSep 25, 2026
- 43operating systemsVirtual Memory and the Page-Fault PathVirtual memory lets each process use an address space that is translated through page tables and hardware translation caches. On a memory access, the processor first uses a translation lookaside buffer when possible.5 stagesSep 25, 2026
- 44system designChoosing an Architecture Style From ConstraintsAn architecture style shapes how components communicate, deploy, and fail. A small team with one release cadence may benefit from a monolith whose internal modules have explicit interfaces.5 stagesSep 25, 2026
- 45system designRaft Uses Terms and Quorums to Choose a LeaderConsensus lets a group of processes agree on an ordered sequence of decisions despite specified failures. Each server tracks a current term.5 stagesSep 25, 2026
- 46system designContainers Package Processes With Shared-Kernel IsolationA container is a way to package a process and its dependencies while applying isolation and resource controls. A container image supplies filesystem layers and runtime configuration.5 stagesSep 25, 2026
- 47system designA Change Travels Through Delivery and FeedbackContinuous delivery makes a change releasable through repeatable build, validation, and deployment steps. A pipeline can build an artifact once, run checks, deploy it to a small cohort, and compare error rate and latency before widening rollout.5 stagesSep 25, 2026
- 48system designDesign Patterns as Named TradeoffsA design pattern names a recurring structure for solving a family of design problems. The Strategy pattern lets a caller choose among interchangeable algorithms behind a common interface.5 stagesSep 25, 2026
- 49system designReliability Comes From Explicit Failure BehaviorAn unreliable component does not make a system unreliable if the system contains and recovers from its failure. If a recommendation service fails, a commerce application might continue checkout without recommendations.5 stagesSep 25, 2026
- 50system designGit History as a Reproducible Change RecordGit records snapshots and relationships between commits. A commit records a tree plus metadata and parent references.5 stagesSep 25, 2026
- 51system designInfrastructure Changes Need Reviewable StateInfrastructure as code describes resources and their relationships in versioned files. A change that adds a database replica can be reviewed for cost, networking, and failover consequences before apply.5 stagesSep 25, 2026
- 52system designDeployments Reconcile Desired StateKubernetes controllers continuously compare observed cluster state with a declared desired state. When a container image changes, a Deployment can create a new ReplicaSet and gradually shift replicas according to rollout settings.5 stagesSep 25, 2026
- 53system designLatency, Throughput, and Queueing Are LinkedLatency measures how long one operation takes; throughput measures how many operations complete per unit time. If a service can process 500 requests per second but receives 700, backlog grows until arrivals fall, requests are shed, or the service fails.5 stagesSep 25, 2026
- 54system designModule Boundaries Should Follow ChangeA module groups decisions that are likely to change together and hides details other modules do not need. If billing and email share a database table but change for different reasons, each may be better represented by its own module even when both run in one process.5 stagesSep 25, 2026
- 55system designDistributed Calls Can Fail Halfway ThroughIn a distributed system, a caller may lose contact with a process that is still running, or receive no response after the remote side completed its work. A client starts a request with a deadline.5 stagesSep 25, 2026
- 56system designRetries Need an Operation ContractA retry repeats work after the caller cannot determine whether an earlier attempt completed. An idempotency key lets the service associate repeated attempts with one logical operation and return the recorded result.5 stagesSep 25, 2026
- 57system designChoose Tests by the Failure They Can CatchTests provide evidence about behavior at different boundaries. A unit test can verify that a retry policy stops after its configured budget.5 stagesSep 25, 2026
- 58system designStart System Design With a Workload ModelA workload model describes request rates, payload sizes, read/write mix, burstiness, and latency goals. If one million users each make two requests per day, the average is far below the peak if activity clusters around a short window.5 stagesSep 25, 2026