Fraud Detection System Low-Level Design
6 min read Requirements Detect fraudulent transactions in real time (<200ms per transaction decision) Flag suspicious user behavior: account takeover, card testing, synthetic […] Read article
6 min read Requirements Detect fraudulent transactions in real time (<200ms per transaction decision) Flag suspicious user behavior: account takeover, card testing, synthetic […] Read article
6 min read What is Topological Sort? A topological ordering of a directed acyclic graph (DAG) is a linear ordering of vertices such Read article
6 min read What an API Gateway Does An API gateway is the single entry point for all client requests to a microservices Read article
6 min read Requirements Record every ad click event (ad_id, user_id, timestamp, ip, device_type) Query click counts per ad for any time range Read article
6 min read Core Idea A stack (LIFO) is the right tool when the most recently seen element determines the action for the Read article
6 min read Why Distributed Locks? In a distributed system, multiple servers run the same code concurrently. A distributed lock ensures only one Read article
5 min read Requirements Update a player score in real time Query the global top-100 leaderboard Query a player’s exact rank among all Read article
6 min read The Pattern Divide and conquer splits a problem into independent subproblems, solves each recursively, and combines the results. Three steps: Read article
6 min read Requirements One-on-one messaging and group chats (up to 500 members) Real-time message delivery (< 100ms), offline message storage, read receipts Read article
6 min read GCD and LCM Euclidean algorithm: gcd(a,b) = gcd(b, a%b), base case gcd(a,0) = a. Time O(log min(a,b)). LCM: lcm(a,b) = Read article
6 min read Requirements Users can browse events, select seats from a seat map, reserve seats, and complete payment Prevent double-booking: no two Read article
6 min read Upload Pipeline Raw video upload → object storage (S3 raw bucket) → message published to transcoding queue (SQS/Kafka) → transcoding Read article
5 min read Core Idea Build a prefix array where prefix[i] = arr[0] + arr[1] + … + arr[i-1]. Then any range sum Read article
6 min read What a CDN Does A Content Delivery Network caches content at edge Points of Presence (PoPs) geographically close to users, Read article
7 min read Two Graph Models The first design decision is the relationship model: Directed graph (Twitter/Instagram follow): A follows B does not Read article