Search

Lessons (21)

  • Caching, Consistent Hashing and Sharding

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

  • Hash Maps & Sets

    … A hash map is that catalogue. A hash function turns a key (like "apple" ) into a number (a …

  • Small Functions That Do One Thing

    … this also starts a session function checkPassword(user, password) { const ok = bcrypt.compareSync(password, user.hash); if (ok …

  • DSA Interview Patterns Cheat Sheet

    … 4. Optimise: "The bottleneck is the inner search… a hash map makes that O(1)." Name the pattern …

  • Topics, Partitions & Offsets

    … order-42"] -- "hash → 1" P1[Partition 1] K2["key: order-77"] -- "hash → 0" P0[Partition 0] K3["key …

  • Scaling, Load Balancing & Rate Limiting

    … active requests Requests vary in duration IP hash / consistent hashing Same client → same server Need stickiness or cache …

  • Authentication, Authorization & API Security

    … AuthZ = what you may do (403). - Hash passwords with argon2id or bcrypt; never store or log them in …

  • SQL Language, Identifiers & Data Types

    … UNION vs UNION ALL UNION removes duplicates, usually with sort/hash work. UNION ALL returns every row and …

  • Exactly-Once Payment Processing

    … a unique database key and store a request hash. Reject reuse of the key with a different amount …

  • Caching & Redis

    … SET , GET , INCR , EXPIRE Cache, counters, rate limits Hash HSET , HGETALL User sessions, objects List LPUSH , RPOP , BLPOP …

  • Replication, Partitioning & Sharding

    … tenant id is often safer than an arbitrary hash when tenancy is a hard isolation boundary. Avoid hot …

  • Big-O Notation Made Simple

    … O(1) Constant 1 Array index arr[5] , hash map lookup O(log n) Logarithmic ~10 Binary search …

  • Linked Lists

    … on repeat (circular), LRU caches (doubly linked list + hash map), undo stacks, OS task scheduling. Technique 1: Traverse …

  • Clean Architecture

    … await this.passwordHasher.hash(password) }); const saved = await this.userRepository.save(user); await this.emailSender.sendWelcome(saved.email …

  • Two Pointers & Sliding Window

    … br/ of seen values?"} C -- Yes HM["🗂️ Hash map"] C -- No D["Consider sorting first,<br/ then …

  • SQL vs NoSQL Databases

    … profiles, CMS content MongoDB Key-value A giant hash map Caching, sessions, counters Redis, DynamoDB Wide-column Rows …

  • ConfigMaps, Secrets & Storage

    … put a hash of the config in a pod annotation, so changing the config triggers a rolling restart …

  • Kafka Producers

    … JSON / Avro / Protobuf)"] Ser -- Part["2️⃣ Partitioner<br/ hash(key) % partitions"] Part -- Batch["3️⃣ Batch buffer<br/ per …

  • REST API Design

    … error: "Request in progress" }); await idempotency.start(key, hash(req.body)); // UNIQUE constraint stops concurrent duplicates const payment …

  • Database Indexing & Transactions

    … tree (default) = , < , , BETWEEN , ORDER BY , prefix LIKE 'abc%' Hash Equality only GIN Full-text search, JSONB, arrays GiST …

  • Frontend Performance & Core Web Vitals

    … public, max-age=31536000, immutable for hashed static files ( app.3f9a1c.js ); short or no-cache for HTML …