Recursion and Divide-and-Conquer Interview Patterns: Merge Sort, Quick Select, and Power (2025)
Recursion Fundamentals Every recursive solution has: a base case (stops the recursion), a recursive case (reduces the problem), and a […]
Recursion Fundamentals Every recursive solution has: a base case (stops the recursion), a recursive case (reduces the problem), and a […]
Core Entities Cart: cart_id, user_id (NULL for guest), session_id (for guest carts), status (ACTIVE, ABANDONED, CHECKED_OUT), currency, created_at, updated_at, expires_at.
Geospatial Data Fundamentals Geospatial queries are common in production systems: “find the 10 nearest restaurants,” “is this user inside a
Trie Fundamentals and Implementation A trie (prefix tree) stores strings character by character, sharing prefixes among strings. Each node represents
Core Entities Home: home_id, owner_id, name, address, timezone, created_at. Room: room_id, home_id, name, floor_number. Device: device_id, home_id, room_id, name, type
Binary Search Fundamentals Binary search finds a target in a sorted collection in O(log n). The key insight: at each
Why Distributed Caching? A single application server’s in-memory cache is lost on restart and not shared across instances. A distributed
Core Entities Tenant: tenant_id, name, slug, plan, custom_domain, storage_quota_gb, created_at. (Multi-tenant: each customer organization is a tenant with isolated content.)
What is an API Marketplace? An API marketplace (like Stripe, Twilio, RapidAPI, or AWS API Gateway) lets external developers discover,
Union-Find Data Structure Union-Find (also called Disjoint Set Union, DSU) tracks which elements belong to the same connected component. Supports
Feed Architecture Overview A social feed shows users content from people and pages they follow, ranked by predicted engagement. The
The Monotonic Stack Pattern A monotonic stack maintains elements in strictly increasing or strictly decreasing order. When a new element
Stack: LIFO and Its Applications A stack (Last In, First Out) is the go-to structure when you need to process
Core Entities Member: member_id, user_id, program_id, tier (BRONZE, SILVER, GOLD, PLATINUM), points_balance, lifetime_points (never decrements — used for tier calculation),
The Two Pointers Pattern Two pointers uses two indices that move toward each other (or in the same direction) to