Search

Lessons (40)

  • DBMS Foundations, Keys & Normalization

    Detailed interview answers for DBMS advantages, normalization, keys, abstraction and conceptual design. Covers PDF questions 1-5, 12 …

  • Database Relations & Foreign Keys

    Model one-to-one, one-to-many and many-to-many data with keys, constraints and deletion rules …

  • Topics, Partitions & Offsets

    … JSON.stringify({ type: "OrderPlaced" }) }, { key: "order-42", value: JSON.stringify({ type: "OrderPaid" }) }, // same partition, after Placed { key: "order …

  • Normalization & Denormalization

    … no non-key depends on another non-key Rule: be in 2NF, and a non-key attribute must …

  • Exactly-Once Payment Processing

    … Reject reuse of the key with a different amount. Send the same key to the provider: your database …

  • Hash Maps & Sets

    … A hash function turns a key (like "apple" ) into a number (a bucket index), so the computer jumps …

  • REST API Design

    … POST /payments, Idempotency-Key: abc123 S- DB: INSERT key abc123 (UNIQUE) → PROCESSING S- S: charge card 💳 S- DB …

  • Caching & Redis

    … Hot key One key (a celebrity's profile) gets so much traffic it overloads a single Redis node …

  • Replication, Partitioning & Sharding

    Scale reads with replicas, split data safely with partitions and shards, and plan for consistency, hot keys and …

  • Caching, Consistent Hashing and Sharding

    … A hash ring moves only some keys when nodes change. Choose a stable shard key such as tenant …

  • SQL vs NoSQL Databases

    … tables, rows, relationships sql CREATE TABLE customers ( id BIGSERIAL PRIMARY KEY, email TEXT NOT NULL UNIQUE, name TEXT …

  • Structural Patterns: How to Connect Objects

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

  • React Fundamentals

    … Using the array index as the key causes bugs when items are reordered or removed. State: data that …

  • Design a Chat Application

    … A client idempotency key makes reconnect/retry safe. Order messages by conversation key, not globally. Presence is temporary …

  • Real-Time, Pub/Sub, Webhooks and CDC

    … Include event ID, schema version, ordering key and trace context; consumers deduplicate and send exhausted failures to a …

  • ConfigMaps, Secrets & Storage

    … shop-api-config, key: LOG LEVEL } a single key volumeMounts: - name: settings mountPath: /etc/shop → /etc/shop/app …

  • Kafka Producers

    … CompressionTypes.GZIP, messages: [ { key: order.id, // keeps all events for this order in order value: JSON.stringify({ orderId …

  • Flash Sale: 10 Million Buyers, No Oversell

    … A Redis Lua script can gate a hot key, but strict no-oversell still needs a durable owner …

  • Scaling, Load Balancing & Rate Limiting

    … the key to scaling out If a server keeps user sessions in its own memory , the next request …

  • Database Indexing & Transactions

    … Check pg stat user indexes and remove them. Index these: primary keys (automatic), foreign keys, columns in frequent …

  • React Hooks in Practice

    … It's the main way to share stateful logic between components. jsx function useLocalStorage(key, initialValue) { const [value …

  • Delivery Guarantees: At-Most, At-Least & Exactly Once

    … async ({ topic, partition, message }) = { const tx = await producer.transaction(); try { await tx.send({ topic: "ledger", messages: [{ key: message …

  • Message Queues & RabbitMQ

    … using bindings . mermaid flowchart LR P[Producer] -- "routing key:<br/ order.created" X{{Exchange}} X -- binding order. Q1 …

  • D — Dependency Inversion Principle

    … The key to swappable, testable code. The big idea Your lamp doesn't have a wire soldered directly …

  • Design a URL Shortener

    … Store code, destination, owner, expiry and status with a unique key. Redirects read edge/cache then durable storage …

  • Design an E-Commerce Checkout

    … reserve inventory atomically, create/get a payment attempt with an idempotency key, then commit an order and publish …

  • Design a Reliable Notification System

    … notifications.svg) Create an immutable request with idempotency key, audience, channel, template version, priority and expiry. Enforce consent …

  • How a Web Request Works

    … TLS handshake (certificate, keys) B- LB: GET /products/42 LB- S: forward to a healthy server S- DB …

  • What Is Apache Kafka?

    … append an event const producer = kafka.producer(); await producer.connect(); await producer.send({ topic: "orders", messages: [{ key: "customer …

  • Batch vs Stream and Data Modeling

    … must stay in sync Streams need an ordering key, idempotency, retention and DLQ. Batch jobs need isolation so …

  • Deployments, ReplicaSets & Rollouts

    … how objects find each other Labels are key/value tags on objects. Selectors pick objects by label. This …

  • Data Structures for Scale

    … distinct items? Approximate count Count-Min Sketch Which keys are frequent? Overestimation MinHash How similar are two sets …

  • Design a Social Media Feed

    … storage, eventual consistency and safeguards for celebrity hot keys. ![Social feed: write a post once, then fan out …

  • Database Internals, Replication and Scaling

    … relational, document, key-value, wide-column, graph, time-series, search and vector stores solve different queries.

  • API Gateway, BFF & Service Discovery

    … ask at the desk, which checks their room key and sends the request to the right place. An …

  • Serverless Architecture

    … getObject(record.s3.bucket.name, record.s3.object.key); const thumbnail = await sharp(image).resize(200).webp().toBuffer …

  • Onion Architecture & Clean vs Hexagonal vs Onion

    … at the bottom that everything depends on, or at the edge where it depends on the domain. Key …

  • Creational Patterns: How to Make Objects

    … config.method = method; return this; } header(key, value) { this. config.headers[key] = value; return this; } timeout(ms) { this …

  • Sorting Algorithms

    … That matters when you sort by several keys. The simple O(n²) sorts Bubble sort: big items "bubble …

  • Timeouts, Retries & Backpressure

    … temporary failure. Payment 450 ms Reconcile with idempotency key. Safety margin 150 ms Return before caller gives up …