Search
Lessons (40)
- Delivery Guarantees: At-Most, At-Least & Exactly Once
… write again → duplicate unless idempotent Fix the duplicates on the consumer side with idempotency: js // Option 1: remember …
- DRY: Don't Repeat Yourself
… Learn when to remove duplication, and when duplication is actually fine. The big idea Imagine your phone number …
- Payment Retries: Prevent Duplicate Charges
… What if the payment company can't look up or de-duplicate by key? Then you cannot promise …
- Message Delivery: Queues, Kafka, Ordering and DLQs
Pick the right kind of message system, and plan up front for duplicate messages, ordering, broken messages and …
- AWS Data Pipelines in Plain Language
… A production pipeline would also address malformed records, currency, duplicate IDs, changing schemas, and reconciliation with the source …
- AWS Messaging: Queues, Topics and Events
… consumers share processing, with retry and duplicate handling SNS A topic: one message can notify many subscribers EventBridge …
- Real-Time, Pub/Sub, Webhooks and CDC
… Expect duplicates, and keep trying (within limits) Most event systems promise at-least-once delivery: an event will …
- Batch vs Stream and Data Modeling
… For fast checks, stream, but plan for duplicates and late events ✅ For fraud checks: - Give every event a …
- Design a Reliable Notification System
… How much duplication is OK depends on the channel. A duplicate promo push is annoying. A duplicate 2FA …
- SQL Language, Identifiers & Data Types
… UNION vs UNION ALL UNION removes duplicates, usually with sort/hash work. UNION ALL returns every row and …
- Big Data: ETL, Warehouses and Streaming
… cleaned, duplicates removed, sorted by event time (when it actually happened, not when it arrived; a phone offline …
- Kafka Producers
… But a retry can create a duplicate : mermaid sequenceDiagram participant P as Producer participant B as Broker P …
- N+1 Queries, Loading & Pagination
… In development, log duplicate query fingerprints. In production, sample traces rather than logging sensitive SQL values.
- Design a Chat Application
… Save first, say "sent" second, and block duplicates 1. Save the message, giving it the next sequence number …
- DSA Interview Patterns Cheat Sheet
… Ask about input size, duplicates, negatives, empty input. 2. Examples: work one normal example and one edge case …
- Message Queues & RabbitMQ
… be lost, never duplicated Ack before processing At least once ⭐ Never lost, may be duplicated Ack after processing …
- Event-Driven Architecture
… local copy and never call back; data is duplicated 3. Event sourcing Events are the source of truth …
- Drift, Troubleshooting, and Disaster Recovery
… Re-running blindly can create duplicates or naming conflicts. Respond to drift If someone changed a bucket tag …
- 500 Users Upload Documents at Once: Design the Background Job Pipeline
… So redoing the job overwrites the half-written data instead of making duplicates. Then the embedding service starts …
- SQL Interview Query Drills
Correct solutions for duplicates, above-average values and third-highest salary. Covers PDF questions 23, 25 and 26 …
- Design a Social Media Feed
… 3. Remove duplicates (the same ID could appear twice). 4. Hydrate : look up the full post details (text …
- The Hot SKU Alert Problem
… we must choose between a possible duplicate and a possible miss. How to prove it works 1. Do …
- Code Smells & Refactoring
… long function, large class, duplication, feature envy, primitive obsession, switch statements. - Tiny steps, run tests, commit, repeat.
- Releases, Observability and Production Safety
… 4. Find and refund the duplicate payments (rollback doesn't undo payments already made). This only works because …
- Two Pointers & Sliding Window
… remove duplicates in place (fast & slow) js // [1, 1, 2, 2, 2, 3] → first 3 slots become [1 …
- REST API Design
… 404 Not Found] F -- yes C{Conflict?<br/ duplicate / stale version} C -- yes E409[409 Conflict] C -- no …
- Normalization & Denormalization
… It is not an accidental duplicate of current catalog price: it represents a different business fact. Third Normal …
- Product-Scale Frontend Patterns
… A queued action needs an idempotency key so replay does not create duplicates. text client action - durable local …
- L6 Production Debugging Casebook
… Ownership just changed between the work and the commit. The fix: stop duplicate effects , not duplicate delivery : - make …
- Advanced TypeScript for Frontend
… Omit , Record , ReturnType and conditional types can remove duplication. Stop when the type becomes harder to understand than …
- AI Agents and Tool Use
… Handle timeouts, duplicate calls, partial failures, and retries. Record enough trace information to understand what happened without logging …
- Embeddings, Semantic Search, and RAG
… Overlap can preserve boundaries, but excessive overlap duplicates content and increases cost. Trust and access control Retrieved text …
- Serverless: Lambda and API Gateway
… Your handler must handle the same event more than once without creating duplicate charges, emails, or records. Use …
- Collaborative Document Editing & Real-Time Sync
… 2. Duplicate edits: resend the same edit 5 times. It must be applied once. 3. Offline merge: edit …
- Rust: Ownership, Borrowing and Lifetimes
… T , Box<T , most structs Copy Bits are duplicated, both usable i32 , f64 , bool , char , &T , tuples of …
- Data Preparation and Model Training
… Check for missing values, duplicates, inconsistent units, stale records, skewed classes, and labels that are ambiguous or wrong …
- Kafka for Backend Services
… true }); // no duplicates from producer retries export async function runRelay() { await producer.connect(); while (true) { const client = await …
- Flash Sale: 10 Million Buyers, No Oversell
… once (after a worker crash), which can create duplicate reservations unless each purchase has a stable ID. - The …
- Design a Polite Web Crawler
… If two different URLs give the same fingerprint, they're duplicates. Normalize carefully . Removing ?page=2 would merge …
- System Design Interview Framework
… The database already has that ID, so it doesn't create a duplicate . It just returns the saved …