String Hashing Interview Patterns
Why String Hashing? Naive string comparison is O(L) per comparison where L is the string length. String hashing converts a […]
Why String Hashing? Naive string comparison is O(L) per comparison where L is the string length. String hashing converts a […]
What is a Distributed Configuration Service? A configuration service manages application settings, feature flags, and operational parameters across a distributed
Requirements Search available rooms for a date range (check-in, check-out, guests, room type) Book a room: prevent double-booking the same
When to Use Two Pointers Two pointers reduce O(n²) brute force to O(n) or O(n log n) by exploiting sorted
What is A/B Testing? A/B testing (controlled experimentation) randomly assigns users to experimental variants and measures which variant produces better
Requirements Producers enqueue tasks; workers process them asynchronously At-least-once delivery: tasks must not be lost on worker crash Retry with
Essential Bit Operations x & y # AND: both bits must be 1 x | y # OR: at least
Requirements Ingest billions of events per day (page views, clicks, transactions, errors) Support real-time dashboards with <10 second lag Support
Requirements Detect fraudulent transactions in real time (<200ms per transaction decision) Flag suspicious user behavior: account takeover, card testing, synthetic
What is Topological Sort? A topological ordering of a directed acyclic graph (DAG) is a linear ordering of vertices such
What an API Gateway Does An API gateway is the single entry point for all client requests to a microservices
Requirements Record every ad click event (ad_id, user_id, timestamp, ip, device_type) Query click counts per ad for any time range
Core Idea A stack (LIFO) is the right tool when the most recently seen element determines the action for the
Why Distributed Locks? In a distributed system, multiple servers run the same code concurrently. A distributed lock ensures only one
Requirements Update a player score in real time Query the global top-100 leaderboard Query a player’s exact rank among all