6 min read Core Entities Patient: (patient_id, name, dob, allergies[], insurance_id, primary_care_provider_id). Prescription: (rx_id, patient_id, prescriber_id, drug_ndc, drug_name, dosage, quantity, days_supply, refills_remaining, written_date, […] Read article
6 min read Requirements and Scale Search autocomplete suggests query completions as the user types. Design constraints: latency must be under 100ms (users […] Read article
6 min read Core Entities Policy: (policy_id, policyholder_id, policy_type=AUTO|HOME|HEALTH|LIFE, coverage_amount_cents, premium_cents, deductible_cents, start_date, end_date, status=ACTIVE|EXPIRED|CANCELLED). Claim: (claim_id, policy_id, claimant_id, incident_date, reported_date, claim_type, description, […] Read article
6 min read The Feed Problem A social network feed shows a user the recent posts from people they follow, ranked by relevance […] Read article
7 min read Segment Tree A segment tree answers range queries (range sum, range minimum) in O(log n) and supports point or range […] Read article
4 min read Core Entities Wallet: (wallet_id, user_id, currency, balance_cents, status=ACTIVE|FROZEN|CLOSED, created_at). One user may have multiple wallets (different currencies). LedgerEntry: (entry_id, wallet_id, […] Read article
6 min read Core Entities Ticket: ticket_id, customer_id, subject, description, priority (LOW, MEDIUM, HIGH, URGENT), status (OPEN, IN_PROGRESS, WAITING_ON_CUSTOMER, RESOLVED, CLOSED), category, assigned_agent_id, […] Read article
5 min read Core Entities PaymentIntent: intent_id (idempotency key), amount_cents, currency, customer_id, payment_method_id, status (CREATED, PROCESSING, SUCCEEDED, FAILED, CANCELLED), created_at, metadata. PaymentMethod: method_id, […] Read article
5 min read The Sliding Window Technique for Strings A sliding window maintains a contiguous substring without re-scanning from scratch. Two pointers (left […] Read article
6 min read Core Entities Post: post_id, user_id, content, media_urls[], platforms[] (TWITTER, INSTAGRAM, LINKEDIN, FACEBOOK), scheduled_at (UTC), status (DRAFT, SCHEDULED, PUBLISHING, PUBLISHED, FAILED), […] Read article