Tree Traversal Interview Patterns: Inorder, Level Order, Zigzag, and Serialize/Deserialize (2025)
The Four Traversals Binary tree traversals: Inorder (left, root, right) — gives sorted order for a BST. Preorder (root, left, […]
The Four Traversals Binary tree traversals: Inorder (left, root, right) — gives sorted order for a BST. Preorder (root, left, […]
Core Requirements A coupon system allows businesses to issue discount codes that customers apply at checkout. Types: percentage discount (20%
Core Entities Customer: customer_id, name, date_of_birth, ssn_hash, address, kyc_status (PENDING, VERIFIED, REJECTED). Account: account_id, customer_id, account_type (CHECKING, SAVINGS, MONEY_MARKET), status
Recognizing DP Problems Dynamic programming applies when a problem has two properties: (1) Optimal substructure: the optimal solution to the
Why Audit Logs? An audit log records every significant action in a system: who did what, to which resource, when,
Core Entities Rider: rider_id, name, phone, email, payment_method_id, rating, total_trips. Driver: driver_id, name, phone, license_number, vehicle_id, status (OFFLINE, AVAILABLE, ON_TRIP),
What is Topological Sort? A topological sort of a Directed Acyclic Graph (DAG) is a linear ordering of vertices such
The Flash Sale Problem A flash sale offers a limited quantity of items at a steep discount for a short
Core Entities Workspace: workspace_id, name, owner_id, plan (FREE, PRO, ENTERPRISE), created_at. Board: board_id, workspace_id, name, description, visibility (PUBLIC, PRIVATE, WORKSPACE),
Why String Hashing? Naive string matching (check every position in the text for the pattern) is O(n*m) where n =
Core Requirements An inventory management system tracks the quantity of products across one or more warehouses, coordinates stock reservations during
Core Entities Auction: auction_id, seller_id, item_id, title, description, start_price, reserve_price (nullable, minimum price to sell), buy_now_price (nullable, instant purchase), start_time,
BFS Fundamentals BFS (Breadth-First Search) explores a graph level by level, visiting all nodes at distance 1 before distance 2,
Core Requirements A digital wallet holds a user’s balance and enables peer-to-peer transfers. Key operations: add money (top-up from a
Core Entities Course: course_id, title, description, instructor_id, category, level (BEGINNER, INTERMEDIATE, ADVANCED), language, price, published_at, status (DRAFT, PUBLISHED, ARCHIVED), total_enrolled.