Design (LLD) Twitter - Machine CodingSubhahu Jain·Dec 31, 2022·7 min readTable of contentsCodeIssues in above design🔥 Problem 1: Everything Is in HashMaps (Concurrency Nightmare)❌ What we Did❌ Why This Is DangerousSolution🔥 Problem 2: Tweet Creation Is a Giant God Method❌ What we Did❌ Why This Is a Design SmellSolution🔥 Problem 3: Timeline Generation Is Not Designed at All❌ What’s MissingSolution🔥 Problem 4: Notification System Is Synchronous and Blocking❌ What we Did❌ Why This Is DangerousSolution🔥 Problem 5: RateLimiter Is Not Thread-Safe (and Incorrect)❌ What we Did❌ Why This FailsSolution🔥 Problem 6: CacheService Is Incorrect by Design❌ What we Did❌ Why This Breaks RealitySolution🔥 Problem 7: No Data Ownership or Aggregate Boundaries❌ Big Missing ConceptSolutionJavaScriptPythonJavaGeneral ProgrammingProgramming Blogs