Design (LLD) Google Maps - Machine CodingSubhahu JainΒ·Dec 31, 2022Β·11 min readTable of contentsCodeIssues in above designπ₯ Problem 1: Map Rendering Is Stateless in Code, Stateful in Realityβ What we Didβ Why This Is a Core Design FlawSolutionπ₯ Problem 2: TileCachingService Is NOT Thread-Safeβ What we Didβ Why This Breaks Under LoadSolutionπ₯ Problem 3: Tile Key Design Is Incorrectβ What we Didβ Why This Is Fundamentally WrongSolutionπ₯ Problem 4: Route Planning Is Naive and Unrealisticβ What we Didβ Why This Is a Huge Red FlagSolutionπ₯ Problem 5: SearchService Is O(N) and Unscalableβ What we Didβ Why This Will Never ScaleSolutionπ₯ Problem 6: CacheService Is Incorrect Under Concurrencyβ What we Didβ Why This Is DangerousSolutionπ₯ Problem 7: Transportation Strategy Is Oversimplifiedβ What we Didβ Why This Is UnrealisticSolutionπ₯ Problem 8: No Concurrency Model for User Requestsβ Missing EntirelySolutionJavaScriptPythonProgramming BlogsGeneral ProgrammingAWS