Advanced Tree Interview Patterns: Segment Trees, Fenwick Trees, Trie Operations, BST Validation (2025)
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
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
6 min read Why Sharding? A single database server has limits: storage capacity (~tens of terabytes), write throughput (~tens of thousands of writes/second), Read article
6 min read The Consensus Problem In a distributed system, multiple nodes must agree on a single value (which node is the leader, Read article
6 min read Core Entities LeaveType: (leave_type_id, name, accrual_rate_days_per_month, max_balance_days, carry_over_max_days, is_paid, requires_documentation). Examples: Annual Leave (1.67 days/month, max 30 days), Sick Leave 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
6 min read When to Use 2D DP 2D DP uses a table dp[i][j] where i and j represent positions in two sequences, 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
6 min read Why Distributed Locks? A mutex works within a single process. A database row lock works within a single database. When Read article
6 min read The Problem with Distributed Transactions In a monolith with a single database, ACID transactions guarantee atomicity: either all operations succeed Read article
6 min read The Core Challenge A flash sale sells a limited quantity (e.g., 1000 units) at a discounted price for a short Read article
5 min read What Is a Config Management Service? A configuration management service stores application settings that need to change without a code Read article
5 min read Core Entities Provider: provider_id, name, timezone, working_hours (JSONB: {“MON”: [“09:00″,”17:00”], …}), slot_duration_minutes (e.g., 30). Appointment: appointment_id, provider_id, client_id, start_time (UTC), Read article
5 min read Core Entities Driver: driver_id, current_location (lat/lng), status (AVAILABLE, ON_TRIP, OFFLINE), vehicle_type, rating. Rider: rider_id, payment_method_id, rating. Trip: trip_id, rider_id, driver_id, Read article
What's missing, wrong, or worth adding? One line helps.
Sent — thank you. We read every one.