Merge Intervals Interview Patterns: Overlapping Intervals, Meeting Rooms, Calendar Problems (2025)
Core Interval Pattern Interval problems involve ranges [start, end] and typically ask: merge overlapping intervals, find gaps, count the minimum […]
Core Interval Pattern Interval problems involve ranges [start, end] and typically ask: merge overlapping intervals, find gaps, count the minimum […]
What is Event Sourcing? In traditional systems, the database stores the current state: the orders table has one row per
What is Multi-Tenancy A multi-tenant SaaS serves multiple customers (tenants) from the same shared infrastructure. Each tenant’s data must be
Problem and Naive DP LIS: find the length of the longest strictly increasing subsequence of an array. Elements of the
Core Entities Plan: plan_id, name, billing_cycle (MONTHLY, ANNUAL, WEEKLY), price_cents, currency, trial_days, features (JSON). Subscription: subscription_id, customer_id, plan_id, status (TRIALING,
Core Entities Flight: flight_id, airline, flight_number, origin_airport, destination_airport, departure_time, arrival_time, aircraft_type, status (SCHEDULED, BOARDING, DEPARTED, ARRIVED, CANCELLED, DELAYED). Seat: seat_id,
Tree DP Pattern Many tree problems require computing an answer that depends on both subtrees. The key pattern: define a
Problem Scope Given a prefix typed by the user, return the top-K (typically 5-10) suggestions ranked by relevance. Used in
What Makes an Algorithm Greedy A greedy algorithm makes the locally optimal choice at each step, hoping this leads to
The Three Pillars of Observability Observability lets engineers understand the internal state of a system from its external outputs. Three
Palindrome Check A palindrome reads the same forward and backward. Brute force check: O(n). Two-pointer: left=0, right=n-1; while left <
Core Entities JobDefinition: job_id, name, type (CRON, INTERVAL, ONE_TIME), schedule (cron expression or interval_seconds), handler (class name or function reference),
The String Matching Problem Given a text T of length n and a pattern P of length m, find all
Core Entities Property: property_id, address, city, state, zip, lat, lng, type (APARTMENT, HOUSE, CONDO, TOWNHOUSE), status (FOR_SALE, FOR_RENT, SOLD, OFF_MARKET),
Core Requirements 1:1 messaging and group chats. Real-time delivery (< 100ms latency). Message persistence: users can scroll back through history.