System Design: Geo-Proximity Service — Location Storage, Radius Search, and Geohashing
What Is a Geo-Proximity Service? A geo-proximity service finds entities (businesses, drivers, users) near a given location. Core operations: store […]
What Is a Geo-Proximity Service? A geo-proximity service finds entities (businesses, drivers, users) near a given location. Core operations: store […]
Core Entities Content: content_id, type (TEXT, IMAGE, VIDEO), author_id, platform, raw_content / storage_url, created_at. ModerationDecision: decision_id, content_id, verdict (APPROVED, REMOVED,
Why Sorting Matters in Interviews Sorting is foundational: dozens of problems become O(n log n) after sorting (two-sum, 3-sum, interval
Core Entities Driver: driver_id, current_location (lat/lng), status (AVAILABLE, ON_TRIP, OFFLINE), vehicle_type, rating. Rider: rider_id, payment_method_id, rating. Trip: trip_id, rider_id, driver_id,
Matrix as a Graph A 2D matrix is an implicit graph where each cell (r, c) is a node connected
What Is Event-Driven Architecture? Event-Driven Architecture (EDA) decouples services by having them communicate through events rather than direct API calls.
Requirements Functional: send notifications via multiple channels (push, email, SMS, in-app), support notification templates with variable substitution, allow users to
The Video Upload and Processing Problem YouTube processes 500 hours of video every minute. Each uploaded video must be transcoded
Requirements Functional: place orders (cart checkout → payment → fulfillment), track order status through lifecycle, handle partial fulfillment (items shipped
Requirements Functional: record expenses with amount, category, date, and notes; support multiple currencies with conversion; tag and categorize expenses; view
Interval Problems: Core Insight Interval problems involve ranges [start, end]. The key operations: merge overlapping intervals, find non-overlapping sets, detect
Requirements Functional: search available rooms by date range and city, view room details and pricing, book a room (atomic reservation),
Requirements Functional: 1-on-1 and group messaging, real-time message delivery, message persistence and history, read receipts (sent/delivered/read), user presence (online/offline/last seen),
Requirements Functional: create coupons (percent off, fixed amount, free shipping), set constraints (minimum order, expiry, usage limits, specific products/categories, single
The Problem: Counting at Scale Incrementing a counter sounds trivial — until you need to count 10 million page views