LLDCoding - Master LLD and Concurrency

WhatsAppYouTube
Buy Course

LLDCoding - Master LLD and Concurrency

Design (LLD) Coupon System For Zepto - Machine Coding Interview

Design (LLD) Coupon System For Zepto - Machine Coding Interview

Subhahu Jain's photo
Subhahu Jain
·Dec 18, 2024·

7 min read

Table of contents

  • Asked in LLD Interview for SDE-2
  • Problem Statement:
  • Key Requirements:
  • Concurrency Requirements:
  • Solution
  • Issues in Above Design
  • 1️⃣ Rule Evaluation Is NOT Thread-Safe by Design (Even If It “Looks” Safe)
    • Current Assumption
    • Hidden Issue
    • Solution
  • 2️⃣ Coupon Evaluation Is Sequential → Latency Explosion
    • Current
    • Problem
    • Solution
  • 3️⃣ Rule Evaluation Repeats the Same Checks
    • Example
    • Solution
  • 4️⃣ RulesFormula Field Is Dead Code
    • Current
    • Issue
    • Solution
  • 5️⃣ No Short-Circuit Optimization Across Coupons
    • Current
    • Problem
    • Solution
  • 6️⃣ CouponRecommendationImpl Is Not Thread-Safe
    • Current
    • Issues
    • Solution
  • 7️⃣ No Concurrency Control for Multi-Threaded Evaluation
    • Missing
    • Solution
  • 8️⃣ No Isolation Between Coupon Failures
    • Problem
    • Solution
  • 9️⃣ No Deterministic Coupon Ordering
    • Current
    • Problem
    • Solution
  • 🔟 No Coupon Compatibility / Stacking Rules
    • Missing
    • Solution
  • 1️⃣1️⃣ No Caching Strategy
    • Missing
    • Solution
  • 1️⃣2️⃣ Rule Interface Is Too Generic
    • Current
    • Problem
    • Solution
  • 1️⃣3️⃣ No Metrics / Observability
    • Missing
    • Solution
  • 1️⃣4️⃣ No Versioning of Rules
    • Missing
    • Solution
  • 1️⃣5️⃣ No Read-Heavy Optimization
    • Reality
    • Solution
zeptoLLDhldProgramming BlogsinterviewBeginner DevelopersDeveloperGeneral ProgrammingJavaScriptJavaObject Oriented Programming

©2026 LLDCoding - Master LLD and Concurrency

Publish with Hashnode

Powered by Hashnode - Home for tech writers and readers