Search

Lessons (40)

  • State Management (Redux, Zustand, TanStack Query)

    Where should data live in a frontend app? Learn the four kinds of state, when local state is …

  • Behavioral Patterns I: Observer, Strategy, Command, State

    … deliver delivered -- [ ] cancelled -- [ ] You've used it: useReducer in React, XState state machines, TCP connection states, order and …

  • React Fundamentals

    Components, props, state and the virtual DOM. Learn to think in React, with a picture of how renders …

  • CQRS & Event Sourcing

    … return { ...state, balance: state.balance + event.amount }; case "MoneyWithdrawn": return { ...state, balance: state.balance - event.amount }; default: return …

  • React Hooks in Practice

    … return { ...state, items: [...state.items, action.item] }; case "remove": return { ...state, items: state.items.filter((i) = i.id …

  • React vs Vue vs Angular

    The same counter in three frameworks, a side-by-side comparison of reactivity, templates, state and tooling, and …

  • TypeScript Essentials

    … T }; function render(state: RequestState<User[] ) { switch (state.status) { case "loading": return "Loading…"; case "error": return Error: ${state …

  • Deployments, ReplicaSets & Rollouts

    … 0 there's zero downtime. - kubectl rollout undo rolls back in seconds. - Use StatefulSets for stateful apps, DaemonSets …

  • Scaling, Load Balancing & Rate Limiting

    … Vertical vs horizontal scaling, load balancers, stateless servers, replication, sharding, rate limiting and resilience basics. The big idea …

  • Design a Chat Application

    … Presence is temporary state with TTL heartbeats; delivery and read receipts are durable state transitions. Offline push comes …

  • Which Pattern Do I Need?

    … Facade simplifies many interfaces into one. Strategy vs State In Strategy the caller chooses. In State the object …

  • Time, Consistency and Distributed Transactions

    … Avoid distributed locks where atomic database/queue claiming owns the state. Two-phase commit offers coordinated atomicity but …

  • ConfigMaps, Secrets & Storage

    … That's perfect for stateless apps, and a disaster for databases. Kubernetes separates "I need 20 GB of …

  • Flash Sale: 10 Million Buyers, No Oversell

    … it is the request whose atomic reservation commits first. ![Flash-sale states: queueing controls traffic while the inventory …

  • Kubernetes Cluster Architecture

    … Validates and stores objects Head office reception etcd A distributed key-value database holding the entire cluster state …

  • SQL Language, Identifiers & Data Types

    … Many systems call COMMIT and ROLLBACK transaction-control statements. Q7: Identity, sequence and UUID An identity/auto-increment …

  • Exactly-Once Payment Processing

    Safe payment retries need a durable idempotency record, atomic state transition and provider-side deduplication. The invariant For …

  • Dynamic Programming

    … 1. State: dp[a] = fewest coins that make amount a . 2. Recurrence: dp[a] = 1 + min(dp[a …

  • Authentication, Authorization & API Security

    … orders of user 42 JWT (stateless tokens) A JSON Web Token carries the user's claims, signed by …

  • Why Kubernetes?

    … What problems Kubernetes solves, the idea of desired state, and when you do and don't need it …

  • ACID, Transactions & Locks

    … current; it means the transaction moves valid state to valid state. Isolation anomalies you should recognize Anomaly Example …

  • MVC, MVP & MVVM

    … Model–View–ViewModel The ViewModel exposes observable state and commands . The View binds to them, so when the …

  • Event-Driven Architecture

    … Event-carried state transfer The data consumers need { type: "CustomerMoved", customerId, newAddress } Consumers keep a local copy and …

  • Design a Reliable Notification System

    Deliver email, SMS, push and in-app messages with preferences, isolation, idempotency, provider failover and auditable states. ![Notification …

  • Code Smells & Refactoring

    … this.currency }).format(this.cents / 100); } } Switch statements → Polymorphism js // ❌ This switch is repeated in area(), perimeter(), draw …

  • System Design Interview Framework

    … Close with failure modes, observability, cost and evolution. State assumptions aloud. Keep the first design simple, name what …

  • Two Pointers & Sliding Window

    … add input[right] to state while (/ window breaks the rule / false) { // 2. remove input[left] from state left …

  • API Contracts, Gateways and Security

    … Sessions are server-managed state; signed tokens carry claims but still need expiry, rotation and revocation strategy. OAuth …

  • JavaScript Essentials: Event Loop, Closures & this

    … Private state (nobody outside can touch balance ) function createAccount() { let balance = 0; return { deposit: (amount) = (balance += amount), getBalance …

  • What Are Design Patterns?

    … Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor mermaid mindmap root((Design Patterns …

  • Serverless Architecture

    … great for spiky workloads. - Design functions to be stateless, small, idempotent and least-privileged; use queues for resilience …

  • Premiere-Night Video Streaming

    … Handles Goal --- --- --- Control Auth, entitlement, manifest, progress Small, stateless, scalable APIs Data Video segments CDN serves bytes from …

  • Transactions, Indexes & Concurrency

    … to rows. Names and behavior vary by engine: state the database product you mean. Q11: Livelock versus deadlock …

  • The L6 System-Design Thinking Loop

    … s DB pool. A useful answer shape 1. State assumptions and the invariant. 2. Draw the smallest normal …

  • Structural Patterns: How to Connect Objects

    … loadMesh(name) }); // heavy return treeTypes.get(key); } // Light, unique data per object (extrinsic state) const forest = Array.from …

  • Service Communication: Sync vs Async

    … sync for queries the user waits on, events for state changes, queues for background jobs.

  • Creational Patterns: How to Make Objects

    … they make testing harder (tests share state) and hide dependencies. Prefer creating one instance in your composition root …

  • Data in Microservices: Sagas & the Outbox Pattern

    … each service what to do and tracks the state. js // A simple orchestrator (tools like Temporal make this …

  • Database Relations & Foreign Keys

    … Good schemas make invalid states hard or impossible to save. ![Relations: foreign keys connect one-to-one, one …

  • Domain-Driven Design: Tactical Patterns

    … load, act, save, publish; thin, no if-statements about business export class PlaceOrderHandler { constructor(private orders: OrderRepository, private …