Search, Geospatial & Real-Time
Search, Geospatial & Real-Time
Search Autocomplete / Typeahead
Trie data structure, top-k per prefix, Redis sorted sets, batch + real-time data pipeline, and personalization
GeoHashLat/lng to string encoding, prefix property, 9-cell proximity search, Redis GEO commands, and limitations at high latitudes
QuadTreeAdaptive 2D spatial partitioning, dynamic subdivision, range queries with pruning, and QuadTree vs GeoHash trade-offs
Uber-Style Location IndexingHigh write-rate GPS ingestion, GeoHash cells in Redis sorted sets, stale cleanup, H3 hexagonal grid, and hot cell mitigation
Presence & Online StatusHeartbeat-based detection, Redis TTL auto-expiry, fan-out optimization via scoped pub/sub, flapping prevention, and multi-device presence
Notification Fanout StrategiesFan-out on write vs read, hybrid approach for celebrities, APNs/FCM push delivery, deduplication with Redis SETNX, and per-user rate limiting
WebSocket at ScaleStateful connection management, sticky sessions, cross-server routing via Redis Pub/Sub, session registry externalization, and heartbeat with exponential backoff reconnection
MQTTLightweight IoT pub/sub protocol, QoS levels (0/1/2), retained messages, Last Will and Testament, persistent sessions, broker clustering, and MQTT vs WebSockets
Payment System DesignDouble-entry bookkeeping, idempotency keys for safe retries, outbox pattern for distributed transactions, nightly reconciliation, and PCI scope reduction via tokenization
Distributed Job SchedulingRedis sorted set delayed queues, atomic poll with Lua scripts, lease-based at-least-once delivery, leader-based distributed cron, and per-tenant fair scheduling
Unique ID GenerationUUID v4 randomness vs B-tree fragmentation, Snowflake 64-bit sortable IDs, ULID timestamp+random, database sequences, and clock skew mitigations