Matrix and Graph Interview Patterns: Island Counting, Shortest Path, and Cycle Detection (2025)
5 min read Matrix as a Graph A 2D matrix is an implicit graph: each cell (r, c) is a node; edges connect […] Read article
5 min read Matrix as a Graph A 2D matrix is an implicit graph: each cell (r, c) is a node; edges connect […] Read article
7 min read Requirements A typeahead service returns query suggestions as the user types. Google Search autocomplete, Twitter’s hashtag completion, and Stripe’s dashboard Read article
8 min read Trie Recap and When to Use A Trie (prefix tree) stores strings character by character. Insert and search are both Read article
8 min read Core Entities Hotel: hotel_id, name, address, star_rating, amenities (JSON array), check_in_time, check_out_time. RoomType: type_id, hotel_id, name (STANDARD, DELUXE, SUITE, PENTHOUSE), Read article
7 min read Why String Algorithms? String matching and processing problems appear regularly in interviews. The naive string search (O(nm) nested loops) is Read article
8 min read Core Entities User: user_id, username (unique, URL-safe), email, password_hash, display_name, bio, avatar_url, role (READER, AUTHOR, EDITOR, ADMIN), created_at. Post: post_id, Read article
8 min read Core Requirements A file sharing platform allows users to upload, organize, and share files and folders. Key features: file upload/download, Read article
7 min read Requirements and Scope An appointment scheduling system allows users (customers) to book time slots with service providers (doctors, barbers, consultants). Read article
7 min read Monotonic Stack Core Idea A monotonic stack maintains elements in a sorted order (increasing or decreasing). As new elements arrive, Read article
7 min read Core Entities Restaurant: restaurant_id, name, address, lat, lng, cuisine_type, rating, prep_time_minutes (avg), is_active, operating_hours. MenuItem: item_id, restaurant_id, name, description, price, Read article
6 min read Requirements A live comments system allows users to post comments on content (articles, videos, livestreams) and see other users’ comments Read article
7 min read Two-Pointer Core Idea Two pointers maintain two indices into a sorted or structured array, moving toward each other or in Read article
7 min read Core Entities Company: company_id, name, description, logo_url, website, size, industry, verified (boolean). Job: job_id, company_id, title, description, location, is_remote, employment_type Read article
7 min read What is a Workflow Engine? A workflow engine executes multi-step processes where steps have dependencies, can run in parallel, and Read article
5 min read Core Entities Contact: contact_id, first_name, last_name, email (unique), phone, company_id, job_title, source (INBOUND, OUTBOUND, REFERRAL), owner_id (assigned sales rep), created_at, Read article