Design (LLD) a Jackpot machine - Machine CodingSubhahu Jain·Feb 14, 2022·4 min readTable of contentsJackpot MachineFeaturesRough Solution (LLD-Machine Coding)Basic EntityImportant PointsFinal CodeBasic EntityImportant PointsFinal CodeIssues in Above Design and Code🔥 Problem 1: Slot Generation Is NOT Deterministic or Testable❌ What we Did❌ What’s WrongSolution🔥 Problem 2: Player State Is Mutated Everywhere (Race Condition Alert)❌ What we Did❌ What’s WrongSolution🔥 Problem 3: Jackpot Rules Are Hardcoded (Design Rigidity)❌ What we Did❌ What’s WrongSolution🔥 Problem 4: Machine Is NOT Concurrency-Safe❌ What we Did❌ What’s WrongSolution🔥 Problem 5: Score Is a Passive Data Bag (Wrong Responsibility)❌ What we Did❌ What’s WrongSolution🔥 Problem 6: No Game Lifecycle Model❌ Missing CompletelySolutioncoding