System Design: Search Ranking — Query Processing, Inverted Index, and Relevance Scoring
7 min read Core Architecture A search system takes a text query and returns a ranked list of documents (web pages, products, articles). […] Read article
7 min read Core Architecture A search system takes a text query and returns a ranked list of documents (web pages, products, articles). […] Read article
7 min read Core Requirements A collaborative document editor allows multiple users to edit the same document simultaneously, with changes reflected in near-real-time Read article
6 min read When Does Greedy Work? Greedy works when the locally optimal choice at each step leads to a globally optimal solution. Read article
7 min read What is a Document Store? A document store (MongoDB, DynamoDB, Couchbase, Firestore) stores JSON-like documents with flexible schemas — each Read article
7 min read Core Entities Event: event_id, name, venue_id, event_date, doors_open, start_time, status (ON_SALE, SOLD_OUT, CANCELLED, COMPLETED), total_capacity. Venue: venue_id, name, address, seating_map_url, Read article
7 min read DP on Trees Overview Tree DP solves optimization problems where the answer for each node depends on the answers for Read article
7 min read Requirements and Scale An analytics pipeline collects events from product surfaces (web, mobile, backend services), processes them in real time Read article
7 min read Core Entities Cart: cart_id, user_id (nullable for guest), session_id (for guest carts), status (ACTIVE, MERGED, ORDERED), created_at, updated_at, expires_at. CartItem: Read article
6 min read The Four Traversals Binary tree traversals: Inorder (left, root, right) — gives sorted order for a BST. Preorder (root, left, Read article
6 min read Core Requirements A coupon system allows businesses to issue discount codes that customers apply at checkout. Types: percentage discount (20% Read article
6 min read Core Entities Customer: customer_id, name, date_of_birth, ssn_hash, address, kyc_status (PENDING, VERIFIED, REJECTED). Account: account_id, customer_id, account_type (CHECKING, SAVINGS, MONEY_MARKET), status Read article
6 min read Recognizing DP Problems Dynamic programming applies when a problem has two properties: (1) Optimal substructure: the optimal solution to the Read article
7 min read Why Audit Logs? An audit log records every significant action in a system: who did what, to which resource, when, Read article
6 min read Core Entities Rider: rider_id, name, phone, email, payment_method_id, rating, total_trips. Driver: driver_id, name, phone, license_number, vehicle_id, status (OFFLINE, AVAILABLE, ON_TRIP), Read article
6 min read What is Topological Sort? A topological sort of a Directed Acyclic Graph (DAG) is a linear ordering of vertices such Read article