100 live scenarios
Technical Interview Practice Library
Easy Scenarios
3 challengesValidate Nested Bracket Sequences
Given a string containing round, square, and curly brackets, determine whether every bracket is properly opened and closed in the correct nested order.
Find a Pair Matching a Target
Given a sequence of integers and a target value, return the positions of two distinct entries whose values add to the target.
Design a URL Shortener
Design a scalable service like bit.ly that redirects short aliases to long URLs.
Medium Scenarios
54 challengesConcurrent Eviction Cache
Implement a bounded cache with recency-based eviction, then reason through thread safety, race conditions, and production hardening.
Delivery Payment Ledger
Build a driver payment ledger in three phases: exact delivery costs from hourly rates and start and end times, payouts that never pay a delivery twice, and a 100,000-delivery performance tier.
Design a Cross-Product Tagging System
Design a shared tagging service that lets users apply tags to entities across multiple Atlassian products, with consistent search and deduplication.
Design a Work-Item Time Metrics Microservice
Design a microservice within a project-management platform that computes time-in-state and SLA metrics from work-item state history.
Design Typeahead
Design the search-box typeahead for a large web search engine: popular completions for every prefix, shared by all users in a locale.
Cheapest Route Within a Stop Limit
Given one-way routes between cities each with a cost, find the cheapest total cost from a source city to a destination city using at most k intermediate stops.
Minimum Coins to Reach an Amount
Given a set of coin denominations and a target amount, find the minimum number of coins (with unlimited supply of each denomination) needed to make exactly that amount, or report it is impossible.
Minimum Time for Contamination to Spread
Given a grid where each cell is empty, clean, or already contaminated, find the minimum time for all clean cells to become contaminated, spreading one step per unit time to adjacent cells, or report it is impossible.
Determine a Valid Course Completion Order
Given a number of courses and a list of prerequisite pairs, determine a valid order to complete all courses, or report that no valid order exists.
Design a Courier Payout Service
Design the service that calculates courier payouts from order activity and upstream timing data.
Design Date-Range File Storage
Design a file storage and indexing system that returns exactly the files created within a requested time interval.
Prefix Lookup Service for a Word Dictionary
Given a dictionary of words, build a structure that can efficiently count how many dictionary words start with a given prefix.
Maximum Sum Contiguous Subarray
Given a non-empty list of integers, find the maximum sum of any contiguous non-empty subarray.
Partition a Set into Two Equal-Sum Groups
Given a set of positive integers, determine whether it can be partitioned into two groups with equal sums.
Group Words by Letter Composition
Given a list of lowercase words, group together the words that share the exact same multiset of letters.
Design a Hotel Reservation System
Design a system like Airbnb or Booking.com where users can search for and book rooms for specific date ranges.
Design Idempotent Request Replay
Design a processor that consolidates duplicate JSON requests and guarantees each logical request is handled once.
Count Connected Land Regions in a Grid
Given a 2D grid of land and water cells, count the number of distinct connected land regions, where cells are connected horizontally or vertically.
Design a Leaderboard
Design a real-time gaming leaderboard (e.g., ESPN, Steam, MMOs).
Longest Strictly Increasing Subsequence
Given a sequence of integers, find the length of the longest subsequence (not necessarily contiguous) whose elements are strictly increasing.
Longest Run of Non-Repeating Characters
Given a string, find the length of the longest contiguous substring in which no character repeats.
Merge Overlapping Room Bookings
Given a list of room booking intervals, each with a start and end time, merge all overlapping or touching intervals into the minimal set of consolidated bookings.
Minimum Worst-Case Drops with Two Bulbs
Given two identical bulbs and a building with F floors, return the minimum number of drops needed in the worst case to guarantee identifying the critical threshold floor.
Track Connectivity Across a Growing Network
Given a number of servers and a sequence of direct connection events between pairs of servers, answer whether two given servers are connected after each event, handling many connections and queries efficiently.
Design a Notification System
Design a scalable notification service that sends emails, SMS, and push notifications to millions of users.
Design an Airline Management System
Design an airline domain model covering airports, aircraft seat layouts, scheduled flights versus dated flight instances, passengers, reservations and tickets, seat assignment, and flight status transitions.
Implement an In-Memory Rate Limiter
Design and implement an in-memory rate limiter as an object-oriented module, validate it with concrete test cases, and discuss concurrency considerations.
Design an ATM Transaction Engine
Design an ATM that authenticates a card and PIN, and supports balance inquiry, cash withdrawal with denomination dispensing, and deposits, including session/state handling and hardware abstractions.
Design Blackjack and a Deck of Cards
Design a reusable deck of cards and a single-round Blackjack game: cards, suits and ranks, deck shuffle/deal, hand scoring with flexible ace values, player and dealer turns, and terminal outcomes (blackjack, bust, win/lose/push).
Design a Power Plant Electricity Allocator
Design a class-level system modeling a power plant that distributes electricity to multiple neighbourhoods, each with a stated demand, subject to the plant's total capacity.
Design a Car Rental System
Design a car rental domain model covering vehicle categories and vehicles, branches, customers and drivers, a rental date range, rate-based quotes, category reservations, vehicle assignment at pickup, and return inspection with extra charges — without overbooking a category or renting one vehicle for overlapping periods.
Design a Group Expense-Splitting Ledger
Design a system where users form groups, log shared expenses split equally, by exact amounts, or by percentage, maintain pairwise balances, and settle debts.
Design a Hotel Management System
Design a hotel domain model covering room types and rooms, guests, a half-open date-range value object, the reservation lifecycle, room assignment, check-in/out, and a charges folio, while preventing overbooking of a room type and overlapping stays on the same room.
Design a Library Management System
Design a library that models catalog titles versus physical copies, members and librarians, checkout/return/renew/reserve flows with loan due dates, an overdue fine policy, and notifications as a boundary.
Design a Meeting Room Booking System
Design a class-level system for booking meeting rooms: register a room, book a meeting given a start time and duration, and cancel an existing meeting with correct conflict detection.
Design a Movie Ticket Seat Booking System
Design a multi-theater ticket booking system where users search movies/showtimes, hold specific seats from a shared seat map, and confirm the hold before it expires, with correctness under concurrent booking attempts.
Design an Online Shopping System
Design an online shopping domain model covering the product catalog, SKU inventory, shopping cart, order lines with snapshotted prices, a checkout flow, a payment boundary, and shipment state transitions.
Design a Multi-Floor Parking Lot
Design a parking lot that assigns compatible spots across multiple floors, issues tickets, tracks capacity, and calculates payment when vehicles exit.
Design a Professional Networking Platform
Design a professional networking domain model covering members and profiles (experience/education), connection requests and undirected connections, and posts with comments and reactions, enforcing symmetric connections, no self-connection, unique pending requests, and profile-edit authorization.
Design a Question and Answer Platform
Design a Q&A platform domain model with users, questions, answers, comments, tags, votes, an accepted-answer rule, and a reputation policy, with the voting, acceptance, and reputation invariants enforced in the model.
Design a Restaurant Management System
Design a restaurant domain model covering tables and capacity, reservations for time slots, seated parties, a menu, orders with priced line items, kitchen status, and bills with payments, keeping booking and order/kitchen state transitions correct.
Design a Multi-Device Smart Home Controller
Design an application that controls multiple smart-home device types (e.g., fan, TV) supporting generic ON/OFF commands common to all devices plus device-specific commands, extensibly.
Design a Social Networking Platform
Design a social networking domain model covering users and profiles, friendship requests and symmetric friendships, and posts with a visibility setting, comments, and reactions — enforcing symmetric friendship, unique requests, author ownership, and visibility-based read authorization.
Design a Vending Machine Controller
Design a vending machine that manages inventory, accepts money, supports product selection and cancellation, returns change, and enforces a clear transaction state machine.
Design a Rate Limiter
Design a service to limit the number of requests a user can send to an API within a time window.
Reverse a Segment of a Linked List
Given the head of a singly linked list and two positions m and n, reverse the nodes from position m to position n in place and return the new head.
Design an Expense Management System
Model the core domain objects, state transitions, approval policies, and audit history for an employee expense management system.
Design a Role-Based Password Validator
Design an extensible validator that applies different password policies to regular users, administrators, and super administrators, handles Unicode input, and rejects passwords on a forbidden or breached-password list.
Search in a Rotated Sorted Array
Given an array of distinct integers that was originally sorted ascending and then rotated at an unknown pivot, determine the index of a target value or report that it is absent.
Design a Rare Book Condition Management System
Model the core domain objects for tracking physical condition assessments of rare library books, with immutable scan history and structured condition report generation.
Count Contiguous Runs Summing to a Target
Given a sequence of integers (possibly negative) and a target sum, count how many contiguous subarrays sum exactly to the target.
Maximize Sum with No Adjacent Elements
Given a list of integers, find the maximum sum you can obtain by choosing elements such that no two chosen elements are adjacent in the list. You may choose no elements, so the answer is 0 for an empty list or when every choice would reduce the sum.
Currency Conversion from Exchange Rates
Given a list of direct exchange rates, find the conversion rate between any two currencies, including pairs that have no direct rate.
Validate the Binary Search Tree Property
Given the root of a binary tree, determine whether it is a valid binary search tree.
Hard Scenarios
43 challengesDesign an Ad Click Aggregator
Design a system to track ad clicks and aggregation for real-time analytics and billing.
Airfield Operations Controller
Design and implement a small airfield scheduler that sequences takeoffs and landings while handling runway conflicts and changing priorities with help from an AI assistant.
Gated Maze Pathfinder
Fix defects in an existing maze-routing codebase, build a shortest-path search that respects one-way gates, then make it fast enough for mazes of up to a million cells.
Unique-Letter Word Picker
Fix defects in a small word-game codebase, write an exact search that picks words sharing no letter for the largest total length, then make it fast on large word lists.
Warehouse Robot Grid Navigator
Build an extensible warehouse navigation service, then evolve it from one robot to multiple robots with collision handling.
Design a Multi-Tenant LLM Inference Platform
Design a global inference service for mixed chat, coding, and long-context workloads across heterogeneous accelerators, starting from one region and model.
Design Anonymous Group Messaging
Design a group messaging application where each member has a different masked identity in every group.
Architecture Deep Dive on Your Past Project
Defend the architecture of a real project you built, its constraints, trade-offs, failures, and how you would redesign it today.
Design a Chat Application
Design a real-time chat application like WhatsApp or Facebook Messenger.
Design Google Docs
Design a real-time collaborative document editor supporting multiple simultaneous users.
Design a Dynamo-Style Highly Available Key-Value Store
Design a highly available, scalable, leaderless key-value store.
Design Dropbox
Design a cloud file synchronization service.
Design Google Maps
Design a mapping service with route planning and ETA calculation.
Design Instagram Feed
Design a photo-sharing social network news feed with complex ranking.
Design Product Search Autocomplete
Design personalized, trend-aware autocomplete and search suggestions for a large online store's product search, built around a ranking model you are given.
Design Slack
Design a real-time messaging platform for enterprises.
Design TikTok's For You Recommendations
Design a high-velocity video recommendation feed (For You Page).
Design Uber Surge Pricing
Design a dynamic pricing engine for a ride-sharing service.
Design a Distributed File System
Design a GFS- or HDFS-style file system that stores petabytes of large files across thousands of servers in one data center for batch processing.
Design a Distributed Message Queue
Design a high-throughput distributed message queue similar to Apache Kafka, with durable replay from stored offsets.
Design Job Scheduler
Design a distributed job scheduler capable of handling recurring and one-time tasks at scale.
Design a Key-Value Store
Design a distributed key-value store like Dynamo or Cassandra with high availability.
Design Reliable Software Updates for a Mars Rover
Design a system that transfers a large software update over an intermittent, low-bandwidth link and safely activates it on a remote rover.
Track the Median of a Growing Stream
Design a structure that supports inserting numbers one at a time from a stream and efficiently reporting the median of all numbers seen so far.
Design a Merchandise Ranking Backend
Design a browsing backend that ranks merchandise using views, cart additions, wishlists, and purchase events.
Design a Political Advertising Safeguard System
Design a system to detect and prevent political advertisements from unauthorized foreign actors from appearing on a social media platform.
Design a Metrics Monitoring System
Design a high-volume system to ingest, store, and visualize metrics from large server fleets, similar to Datadog or Prometheus.
Design Multi-Tenant Vehicle Tracking
Design a shared real-time vehicle tracking platform used by ride-hailing, food delivery, and fleet-management products.
Design a Two-Player Chess Game Engine
Design a chess engine that models a board and pieces, validates legal turns and moves, records move history, and detects check, checkmate, stalemate, resignation, and forfeit.
Design a Cricket Information Platform
Design a cricket scoring domain model covering teams and players, a match, innings, overs and deliveries, batting and bowling scorecards, extras and wickets, striker rotation, over completion, and match results for a configurable limited-overs format.
Design a Multi-Elevator Dispatch System
Design a controller for multiple elevators that accepts hall and cabin requests, schedules cars, models movement and doors safely, and supports replaceable dispatch policies.
Design an Online Stock Brokerage System
Design a brokerage domain model covering accounts and portfolios, instruments, a cash ledger, market and limit orders, immutable fills, derived positions, order state transitions, and an external exchange gateway boundary — without building a matching engine.
Design a Payment System
Design a reliable payment service that charges customers through external payment processors. Focus on correctness and idempotency.
Design Proximity Service
Design a location-based service like Yelp, Uber, or Google Maps Nearby.
Design a Ride-Sharing Service
Design a ride-matching service like Uber or Lyft with real-time location tracking.
Fewest Moves to Solve a Sliding Tile Puzzle
Given a small 2-by-3 sliding tile puzzle board with one blank space, find the minimum number of adjacent tile slides needed to reach a specified target arrangement, or report it is unreachable.
Maximum Value in Every Sliding Window
Given an array and a window size k, return the maximum value within every contiguous window of size k as it slides from left to right across the array.
Design a Stock Exchange
Design an exchange that accepts orders, matches buyers and sellers, publishes market data, and preserves an auditable sequence of trades.
Design a Ticket Booking System
Design a high-concurrency ticket booking system (e.g., Ticketmaster) that can sell out a 100,000-seat event in minutes to millions of fans without overselling.
Design Twitter Feed
Design a scalable news feed system where users can post tweets and follow other users.
Design Product Discovery Inside Video
Design a system that identifies products in video frames and surfaces relevant purchase links while viewers watch.
Design a User-Uploaded Video Streaming Platform
Design upload, transcoding, storage, and playback for a global user-uploaded video platform.
Design a Web Crawler
Design a scalable web crawler like Googlebot to index the internet.