Amazon

An online assessment for many early-career and SDE II roles, a recruiter call, a 60-minute coding screen with Leadership Principles questions, then four or five 55-minute interviews: coding (often object-oriented design), system design, a hiring-manager round and a Bar Raiser, with behavioral questions in every round.

376 questions

  • AI-agent security detection over streaming telemetryAI systemDesign a system in which an AI agent reads a stream of security telemetry and runs detections on it. About 1 TB of data arrives per day. It was asked like a traditional system…
    Last asked Oct 2026
  • Find every recipe you can make from your suppliesCodingYou have an unlimited stock of some basic supplies and a book of recipes. Each recipe has a unique name and a list of ingredients; an ingredient can be a supply, the name of…
    Last asked Oct 2026
  • Minimum time to finish dependent steps run in parallelCodingA job is split into n steps numbered 0 to n - 1; step i takes durationsi minutes. A pair u, v in dependencies means step u must finish before step v starts. Any number of steps…
    Last asked Oct 2026
  • Largest permutation after sorting one fixed-length windowCodingYou get a permutation of 1 to n and a window size w. Exactly once, choose a contiguous window of exactly w elements and sort the elements inside it. Return the lexicographically…
    Last asked Oct 2026
  • Behavioral stories for the Leadership PrinciplesBehavioralEvery interview in the loop sets aside time for behavioral questions tied to the company's Leadership Principles. Expect asks like a deadline you nearly missed, a disagreement…
    Last asked Oct 2026
  • Implement an LRU cacheCodingImplement a least-recently-used cache with get(key) and put(key, value), both in O(1) time, with a fixed capacity.
    Last asked Oct 2026
  • How do you use AI in your work?BehavioralDescribe how AI tools fit into your engineering work: where they help, where they fail, how you verify their output, and how they have changed the way you or your team work.
    Last asked Oct 2026
  • Tell me about a time you overcame a major obstacleBehavioralDescribe a time an unexpected obstacle threatened an important goal. Explain what the obstacle was, your role, the options you weighed, what you did, and how it turned out. Expect…
    Last asked Oct 2026
  • Lowest common manager in an org chartCodingA company's reporting structure is a rooted tree. Each person is an Employee with a unique name and a list reports of the people who report to them directly. The root is the CEO…
    Last asked Oct 2026
  • Maximum frequency stackCodingBuild a stack of integers with push(x) and pop(). pop removes and returns the value that occurs most often in the stack; when several values tie, it takes the one with an…
    Last asked Oct 2026
  • Tell me about a time you improved things for a customerBehavioralDescribe a customer pain point you noticed and acted on, or a time you judged how good the customer experience really was. Explain how you learned what the customer needed, what…
    Last asked Oct 2026
  • Concatenated wordsCodingGiven a list of distinct words, return every word that can be split into two or more pieces that are each a word in the list (the same word may be used more than once). A shorter…
    Last asked Oct 2026
  • Fewest moves for a chess piece to capture the kingCodingA rectangular board has blocked squares, your piece and the opposing king. Your piece's type decides the directions it may step in, and it can never move onto a blocked square…
    Last asked Oct 2026
  • Fix a bug in an unfamiliar repo with an AI assistantCodingYou get a small full-stack repository, a reported defect and an AI coding assistant in the browser. Reproduce the problem, find the root cause, fix it and show the fix works…
    Last asked Sep 2026
  • Tell me about a time you met a tight deadlineBehavioralDescribe a project with a deadline that was hard to meet. Say when you saw the plan was at risk, what you personally did (cut scope, re-plan, ask for help), how you told…
    Last asked Sep 2026
  • Tell me about a time you went beyond your responsibilitiesBehavioralDescribe a time you took on a problem nobody had assigned to you: an inefficient team process you fixed, a tool that helped teams beyond your own, a risky project you owned end to…
    Last asked Sep 2026
  • Work style and situational judgment assessmentBehavioralSome online assessments include a part with no code at all. You read short workplace scenarios and rate or rank possible responses, then choose between pairs of statements about…
    Last asked Sep 2026
  • Evaluate divisionCodingYou get equations a / b = value between string variables, each standing for a positive real number, and a large batch of queries c / d. Answer every query from the equations, or…
    Last asked Sep 2026
  • Transformer and attention fundamentalsML designExplain how a transformer works from the inside: how self-attention is computed, why the scores are scaled, how encoder and decoder masking differ, and what multiple heads buy…
    Last asked Sep 2026
  • ML fundamentals deep dive for ML rolesML designAfter a short walk through your resume, expect fast questions on machine learning basics, usually centred on your own area (language models, vision, recommendations). For each…
    Last asked Sep 2026
  • Reversi move simulation with captures in 8 directionsCodingImplement one move of the board game Reversi (also sold as Othello). You get an n x n board as a list of lists of characters. Each cell is 'B' (black), 'W' (white) or '.' (empty)…
    Last asked Sep 2026
  • Tell me about a time you dove deep to find a root causeBehavioralDescribe a hard problem you had to investigate in depth, such as an intermittent failure where the obvious metrics looked healthy. Walk through the symptom, the hypotheses you…
    Last asked Sep 2026
  • Project deep dive: present a project you ledBehavioralPresent a project you led in about 20 minutes: context, your role, the architecture, three hard trade-offs, metrics, cost and return, and what you would change. Then take 25…
    Last asked Sep 2026
  • Coordinate a fleet of restaurant robotsSystem designDesign the system that coordinates many robots working in a restaurant. Start by pinning down what work the robots do, then cover how tasks are assigned, how execution state is…
    Last asked Sep 2026
  • Design a Kafka-based file watcher for millions of filesSystem designDesign a file watcher that tracks millions of files and publishes change events to downstream consumers through Kafka. Cover the first full discovery of files, ongoing changes…
    Last asked Sep 2026
  • Grid reachability for a robot that cannot reverseCodingA robot moves on a grid of open cells, blocked cells, a start S and a destination D. It always faces one of four directions, can never turn around, and may only turn in the ways…
    Last asked Sep 2026
  • Unix find command with pluggable filtersCodingImplement a small version of the Unix find command over an in-memory file system. The file system holds directories and files. Each file has a name and a size in bytes. Its…
    Last asked Sep 2026
  • Merge ordered streamsCodingMerge several ordered input streams into one ordered output without loading any stream fully into memory. Reported on 1point3acres' Sierra bank; reconstructed in our own words.
    Last asked Sep 2026
  • Lowest common ancestor in a binary search treeCodingGiven a binary search tree and two distinct keys that are both in it, return their lowest common ancestor: the deepest node whose subtree contains both. A node's subtree includes…
    Last asked Sep 2026
  • Ones and zeroesCodingGiven a list of binary strings and two budgets, at most maxzeros zeros and at most maxones ones in total, choose as many strings as possible so that the chosen strings together…
    Last asked Sep 2026
  • Tell me about a time you decided without all the dataBehavioralDescribe an important decision you had to make before you could explore every option or gather all the data, for example under a tight deadline or competing constraints. Explain…
    Last asked Sep 2026
  • Recruiter screen: motivation, background and logisticsBehavioralA short first call with a recruiter: a few standard behavioral questions about your background and why you want the role, then timeline, location and compensation expectations…
    Last asked Sep 2026
  • Design a distribution-center inventory update serviceSystem designDistribution centers send stock updates. Design the service that keeps the latest quantity, availability and last-update time for every location and item pair and answers lookups…
    Last asked Sep 2026
  • Order dependent tasks and find what must rerunCodingGiven tasks and their prerequisites, return any valid order to run them, or detect that the dependencies form a cycle. Then, given a set of tasks that changed, find every task…
    Last asked Sep 2026
  • Word search with a word search II follow-upCodingFind words on a letter grid by adjacent moves, then extend the solution to finding many words at once efficiently. Reported on 1point3acres' Glean bank; reconstructed in our own…
    Last asked Sep 2026
  • Maximum coins from k consecutive bagsCodingBags stand at every positive integer position. Each segment l, r, v says every bag from l to r holds v; segments don't overlap and all other bags are empty. Choose k consecutive…
    Last asked Sep 2026
  • Predict click-through rate for music recommendationsML designDesign a model that predicts whether a user will click a recommended song. Explain how you would embed songs, how you handle the different kinds of features, and how you would…
    Last asked Sep 2026
  • Sliding-window request rate limiterCodingImplement a rate limiter that accepts at most limit requests in any window of ttl milliseconds. - allow(timestamp) is called once per incoming request. timestamp is in…
    Last asked Sep 2026
  • Checkout price engine with pluggable discountsOO designBuild the price engine for an e-commerce checkout. A cart holds line items (product id, unit price, quantity) and the customer has a tier, standard or premium. Apply discounts of…
    Last asked Sep 2026
  • Tell me about a mistake you madeBehavioralDescribe a mistake or failure of yours that had real consequences. Explain what happened, how you found out, how you took responsibility, what you did to fix it, and what you…
    Last asked Sep 2026
  • Tell me about a time you got critical feedbackBehavioralDescribe a time you received negative or critical feedback. Explain what the feedback was, how you reacted, what you changed, and how you showed the improvement, ideally with…
    Last asked Sep 2026
  • Design a notification systemSystem designA shared service other teams call to send push, email and SMS notifications: templates, user preferences, retries, deduplication and rate limits.
    Last asked Sep 2026
  • Design a shopping cart (object-oriented)OO designWrite a small, runnable object model for an online store's shopping cart in the language of your choice: adding products, the other everyday cart operations, and computing the…
    Last asked Sep 2026
  • Decoder-only LLM architecture and how vLLM serves itML designExplain how a decoder-only language model is built, from tokens through the stack of attention and feed-forward layers to predicting the next token. Then explain how an inference…
    Last asked Sep 2026
  • Design a pizza price calculatorOO designModel pizzas with sizes, crusts and toppings, plus deals and coupons, and compute the price of an order. Make it easy to add new toppings and promotions.
    Last asked Sep 2026
  • Fewest edge moves to connect a graphCodingAn undirected graph has n nodes and a list of edges. One move detaches an existing edge and reattaches it between any two distinct nodes. Return the fewest moves needed to make…
    Last asked Sep 2026
  • Simplify an arithmetic expression treeCodingYou get the root of an expression tree: every internal node is a binary operator with two children, and every leaf is an integer constant or a variable name. Return a simplified…
    Last asked Sep 2026
  • Add one delivery center to minimize the worst distanceCodingA grid marks delivery centers with 1 and every other cell with 0. The distance between two cells is max(x1 - x2, y1 - y2) (moving in all eight directions). The grid's…
    Last asked Sep 2026
  • Design a distributed job schedulerSystem designDesign a service that runs millions of scheduled and on-demand jobs (cron-like and one-off) reliably across a fleet of workers.
    Last asked Sep 2026
  • Top K frequent elementsCodingGiven an integer array and k, return the k values that occur most often, in any order; ties at the cutoff may go either way. One version asks for the most frequent request IDs in…
    Last asked Sep 2026
  • Find the median from a data streamCodingNumbers arrive one at a time; after any of them, return the median of everything seen so far. Keep two heaps (a max-heap for the lower half and a min-heap for the upper half)…
    Last asked Sep 2026
  • Linked-list queue with deletionsCodingImplement a queue on a linked list with enqueue and dequeue, then extend it through follow-ups that delete elements from the queue.
    Last asked Sep 2026
  • Tell me about a time you helped a struggling teammateBehavioralDescribe a time a teammate was struggling. Explain how you noticed, what you did to help, how you balanced that with your own work and the team's health, and how things turned out…
    Last asked Aug 2026
  • Valid palindrome ignoring case and punctuationCodingDecide whether a string reads the same forwards and backwards when you ignore letter case and every character that is not a letter or a digit.
    Last asked Aug 2026
  • Sliding window maximumCoding1. Given an array and a window size k, return the maximum of every window of k consecutive elements. 2. As a class: put(number) adds a number to a stream and getMax() returns the…
    Last asked Aug 2026
  • Train fare calculator with a weekend capCodingA train line runs through stations G, U, H, K and I in that order. Each hop between neighbouring stations costs 1, so a trip costs the number of hops it covers (G to I costs 4)…
    Last asked Aug 2026
  • Minimum adjacent swaps to group a binary arrayCodingGiven an array of 0s and 1s, return the fewest swaps of neighbouring elements that put all the 0s at one end and all the 1s at the other. Either order is allowed.
    Last asked Aug 2026
  • Mini spreadsheet with formulas and cycle detectionCodingBuild a mini spreadsheet with cell get and set, formula evaluation over dependencies, cached values with eager updates, and cycle detection. Covers the bank's spreadsheet variants…
    Last asked Aug 2026
  • Fewest global replacements to group equal valuesCodingYou are given an integer array arr of length n. In one operation you pick two different values x and y that both currently appear in arr, and you change every occurrence of x into…
    Last asked Aug 2026
  • Autocomplete product search boxCodingBuild a front-end search box that suggests products as the user types. Debounce the requests so typing doesn't send one per keystroke, and make the component accessible, including…
    Last asked Aug 2026
  • Accessible popovers that load dataCodingBuild popovers for several buttons on a page: each button opens its own popover, which loads its data when opened. Make them accessible and handle the loading state.
    Last asked Aug 2026
  • Design a product image upload pipeline for sellersSystem designDesign the pipeline sellers use to upload product images: accepting the upload, processing the images, storing them, and serving them on product pages.
    Last asked Aug 2026
  • Design faceted product searchSystem designDesign product search for a large catalog where shoppers narrow results with facets (filters on product attributes) and see how many results each filter value has. Cover indexing…
    Last asked Aug 2026
  • Format a forest of nested commentsCodingGiven comments where each one may reply to another, format the whole forest of threads so that every reply appears nested under its parent.
    Last asked Aug 2026
  • JavaScript let versus varCodingPredict what short JavaScript snippets print and explain the difference between let and var: scope, hoisting, and how each behaves in loops and closures.
    Last asked Aug 2026
  • Min-priority queue without a library heapCodingImplement a min-priority queue yourself, without a library heap: insert, look at the minimum, and remove the minimum. Give the cost of each operation.
    Last asked Aug 2026
  • Tell me about a time you raised the quality barBehavioralDescribe a project where you pushed for a higher standard than the team was settling for. Explain what was falling short, what you changed, how you got others to agree, and what…
    Last asked Aug 2026
  • Rearrange a string so no neighbours matchCodingGiven a string s of lowercase English letters, rearrange its characters so that no two adjacent characters are equal. Every character of s must be used exactly once. Implement: 1…
    Last asked Aug 2026
  • Kth largest element in a streamCodingValues arrive one by one. After each value, return the kth largest value seen so far. It was framed as a product catalog that must report its top items.
    Last asked Aug 2026
  • Rate-limited event loggerCodingBuild a logger that rate-limits repeated events in a stream. Each event has a string name and an integer timestamp in seconds. Timestamps arrive in non-decreasing order, and…
    Last asked Aug 2026
  • Design an AI chatbot appAI systemBuild a chatbot app on top of a hosted LLM API: conversations, streamed answers, history, and per-user usage limits.
    Last asked Aug 2026
  • Tell me about a time you worked through ambiguityBehavioralDescribe a project where the requirements were unclear. Explain how you made progress anyway: what you clarified, what assumptions you made and checked, how you kept stakeholders…
    Last asked Aug 2026
  • Earliest pair with a target sumCodingGiven an array of numbers and a target, find the pair of elements that sums to the target and appears earliest in the array.
    Last asked Aug 2026
  • Valid parenthesesCodingGiven a string of brackets (), and {}, decide whether every bracket is closed by the matching type in the right order.
    Last asked Aug 2026
  • Services that go down when their dependencies shut downCodingYou get a map of which services depend on which, and a list of services being shut down. A service is unavailable if it is shut down itself or depends, directly or through other…
    Last asked Aug 2026
  • Angle between clock handsCodingGiven a time in hours and minutes, return the smaller angle between the hour hand and the minute hand.
    Last asked Aug 2026
  • Merge intervalsCodingGiven a list of intervals (for example time ranges), merge every group of overlapping intervals and return the result in sorted order.
    Last asked Aug 2026
  • Roofline analysis of a BF16 MLP layerML designApply roofline analysis to an MLP layer running in BF16: count its floating-point operations and the bytes it moves, compute its arithmetic intensity, and decide whether it is…
    Last asked Aug 2026
  • Design a platform to train and serve ML modelsML designDesign a platform that lets teams train machine learning models and serve them in production. Cover data access, training jobs, storing and versioning models, deployment, and…
    Last asked Aug 2026
  • Meeting rooms: attend all, rooms needed, busiest roomCodingGiven meetings as start and end times: 1. Can one person attend every meeting? 2. What is the fewest rooms needed to hold all of them? 3. With a fixed number of rooms and a rule…
    Last asked Aug 2026
  • Track missing package IDs from out-of-order arrivalsCodingPackages with IDs 1, 2, 3, ... arrive in any order. Support recording an arrival, reporting the contiguous frontier (the largest ID such that every ID up to it has arrived), and…
    Last asked Aug 2026
  • Lowest common ancestor of a binary treeCodingGiven a binary tree (no ordering on the values) and two of its nodes, return their lowest common ancestor: the deepest node that has both in its subtree.
    Last asked Aug 2026
  • Course schedule: finish every course and find an orderCodingYou have n courses and a list of prerequisite pairs. 1. Decide whether every course can be completed. This fails exactly when the prerequisites contain a cycle. 2. Return one…
    Last asked Jul 2026
  • Design a metrics monitoring systemSystem designCollect metrics from every host and service, store them as time series, power dashboards over months of data, and alert when thresholds are crossed.
    Last asked Jul 2026
  • Threshold-based database partition rebalancerCodingWrite a rebalancer for database partitions spread across nodes: when a node's load goes over a threshold, move partitions off it onto other nodes. Explain which partitions you…
    Last asked Jul 2026
  • Predict a future point with a fitted lineML designFit a straight line to a set of data points and use it to predict the value at a future point. Explain how the fit is computed and how far you would trust the prediction.
    Last asked Jul 2026
  • BIOS and UEFI firmwareCodingExplain what BIOS and UEFI firmware do when a machine boots and how they differ, including how each finds and starts the operating system.
    Last asked Jul 2026
  • Edit distanceCodingReturn the fewest single-character insertions, deletions and replacements that turn one string into another.
    Last asked Jul 2026
  • Concurrent restaurant waitlist and seatingOO designDesign and code a restaurant's waitlist and seating: parties join the list, tables free up, and parties get seated. Keep it correct when many requests happen at the same time.
    Last asked Jul 2026
  • Range moduleCodingTrack half-open integer ranges left, right): add a range, remove a range, and ask whether every number in a range is currently tracked.
    Last asked Jul 2026
  • Best time to buy and sell stock, every variantCodingGiven daily stock prices, solve the variants of the maximum-profit problem (for example a single trade, many trades, or at most k trades) with one unified approach.
    Last asked Jul 2026
  • Design Amazon LockerSystem designLet customers pick a locker location at checkout, assign a compartment that fits the package, and give them a code to collect it within a few days.
    Last asked Jul 2026
  • Regular expression matchingCodingDecide whether a whole string matches a pattern where . matches any single character and matches zero or more of the element before it.
    Last asked Jul 2026
  • Maximum overlap of closed intervalsCodingGiven a list of closed intervals start, end (both endpoints included), return the largest number of intervals that contain one point on the number line. Two intervals that only…
    Last asked Jul 2026
  • Shortest grid path with one cell conversionCodingFind the length of the shortest path across a grid when you are allowed to convert one blocked cell into an open one along the way.
    Last asked Jun 2026
  • Shortest delivery route around a ring of hubsCodingDrone hubs sit on a ring, and you know the distance between each hub and its neighbour. The drone visits a list of destination hubs in order, and each leg takes the shorter way…
    Last asked Jun 2026
  • Caesar cipher with wraparound shiftsCodingImplement caesarencrypt(text: str, k: int) - str, which applies a Caesar cipher to text. Every ASCII letter moves k places forward in the alphabet. The alphabet is circular, so a…
    Last asked Jun 2026
  • Design a news feedSystem designDesign the home feed for a social network with 1B users: posts from people you follow, ranked, fresh within seconds.
    Last asked Jun 2026
  • Single element in a sorted arrayCodingIn a sorted array where every value appears exactly twice except one, find the value that appears once, in logarithmic time.
    Last asked Jun 2026
  • GRPO deep dive for a reasoning LLMML designExplain GRPO and why it can drop the critic that PPO uses. Then discuss the parallelism used to train a reasoning language model, multi-head latent attention (MLA), and how you…
    Last asked Jun 2026
  • Design a snake gameOO designDesign the snake game in object-oriented code: the board, the snake, food, moving, growing, and detecting collisions.
    Last asked Jun 2026
  • Find conflicting eventsCodingGiven a list of events with start and end times, find the events that overlap one another.
    Last asked Jun 2026
  • Kth largest perfect binary subtreeCodingIn a binary tree, find every subtree that is a perfect binary tree and return the size of the kth largest.
    Last asked Jun 2026
  • Tokenizer design and KL-regularized fine-tuningML designDiscuss how you would design a tokenizer for a language model and the trade-offs involved. Then explain supervised fine-tuning with a KL penalty that keeps the model close to its…
    Last asked Jun 2026
  • Top-p (nucleus) sampling in NumPyCodingImplement top-p sampling in NumPy: from a vector of logits, keep the smallest set of most likely tokens whose probabilities add up to at least p, renormalize them, and sample one…
    Last asked Jun 2026
  • Detect and break a cycle in a linked listCodingDecide whether a singly linked list has a cycle, find the node where the cycle begins, and break the cycle so the list ends.
    Last asked Jun 2026
  • Fewest bills and coins to make changeCodingGiven an amount and the denominations of the bills and coins available, return the fewest pieces that add up to the amount.
    Last asked Jun 2026
  • Design a library management systemOO designModel books, copies, members, loans, holds and fines for a library, with search and limits on loans per member.
    Last asked Jun 2026
  • Single-direction stock rebalancing on a ringCodingA company keeps stock in n depots placed around a ring. Depot i is joined to depot (i + 1) % n (the clockwise neighbour) and, through the same link, to depot (i - 1 + n) % n…
    Last asked Jun 2026
  • Allocate inventory by bid priorityCodingAllocate a limited inventory across a set of bids, serving the bids in priority order, and report what each bid receives.
    Last asked Jun 2026
  • Asteroid collisionCodingAsteroids move along a line; each has a size and a direction. When two meet, the smaller one explodes, and both explode if they are the same size. Return the asteroids left after…
    Last asked Jun 2026
  • Evaluate a postfix expressionCodingEvaluate an arithmetic expression written in postfix (reverse Polish) notation.
    Last asked Jun 2026
  • Find the closest version by dateCodingGiven versions and their release dates, return the version whose date is closest to a query date.
    Last asked Jun 2026
  • Filter events and route them to queuesCodingProcess a stream of events: apply filter rules to each one and route every event that passes to the right queue.
    Last asked May 2026
  • Design a distributed web crawlerSystem designCrawl billions of web pages politely and repeatedly, deduplicating URLs and content, to feed a search index or a training-data pipeline.
    Last asked May 2026
  • Design SpotifySystem designStream music to hundreds of millions of listeners: catalog, search, playlists, smooth playback over bad networks, and offline downloads.
    Last asked May 2026
  • Minimum processing rate to finish before a deadlineCodingGiven a list of jobs of different sizes and a deadline in hours, find the smallest processing rate that finishes every job in time, when each hour works on a single job at that…
    Last asked May 2026
  • Fill placeholders in a template stringCodingWrite a function that fills in a template string. template may contain placeholders written as {name}. The text between the braces is a variable name. keysi is a variable name and…
    Last asked May 2026
  • Sort an array with rotate and flip operationsCodingYou are given an array arr of n distinct integers. You may apply two operations, and each one counts as one step: - Rotate: remove the first element and append it to the end. p…
    Last asked May 2026
  • Most common website visit patternCodingGiven which user visited which website and when, find the sequence of three websites that the most users visited in that order.
    Last asked May 2026
  • Design a logging serviceSystem designIngest logs from every service at terabytes per day, make them searchable within seconds, and keep them cheaply for months.
    Last asked May 2026
  • Design UberSystem designRiders request trips, nearby drivers get matched, and both see live location until drop-off, with pricing and payment, for millions of trips a day.
    Last asked May 2026
  • Count connected components in an undirected graphCodingGiven n nodes and a list of undirected edges, return the number of connected components. It was also asked with products: each pair says two products are in the same category, and…
    Last asked May 2026
  • Design human avoidance for warehouse robotsSystem designDesign how robots in a warehouse detect and avoid the people working on the same floor: sensing, what each robot decides on its own versus what a central system decides, and…
    Last asked May 2026
  • Searchable sentence indexCodingBuild an index over a collection of sentences so you can quickly find the sentences that contain given words.
    Last asked May 2026
  • Design a highly available load balancerSystem designDesign a load balancer that stays up when its own machines fail: how traffic is spread across backends, how unhealthy backends are detected, and how the load balancer itself…
    Last asked May 2026
  • Unique pairs with a target sumCodingReturn each distinct pair of values from an array that sums to a target, counting a pair only once even when the values repeat.
    Last asked May 2026
  • Extensible cinema ticket pricing engineOO designDesign a ticket pricing engine for a cinema, built so that new pricing rules can be added later without rewriting the engine.
    Last asked May 2026
  • Fewest points to pay across reward programsCodingA user holds points in several programs (airline miles, credit card points, store points). Each program has a balance and a dollar value per point that changes daily. To pay a…
    Last asked May 2026
  • Oldest one-time visitor in a login streamCodingAn online store wants to know which customers have visited only once. Every login is reported to your service as a username, in the order the logins happen. Implement a class…
    Last asked Apr 2026
  • Longest ON run with k range flipsCodingA data center rack holds n servers in a row. Their states are given as a binary string serverstates, where '1' means the server is ON and '0' means it is OFF. An operator may run…
    Last asked Apr 2026
  • In-memory pub/sub with prioritiesOO designDesign and code a publish/subscribe system that runs on one machine: topics, subscribing, unsubscribing and publishing. Follow-up: messages carry a priority and higher-priority…
    Last asked Apr 2026
  • Shift security units left to protect the most populationCodingCities stand in a row, numbered 0 to n - 1. You are given an integer array population of length n (all values = 0) and a binary string unit of the same length. uniti == '1' means…
    Last asked Apr 2026
  • Kth largest element in two sorted arraysCodingFind the kth largest element across two sorted arrays without merging them. Reported on 1point3acres' Glean bank; reconstructed in our own words.
    Last asked Mar 2026
  • Minimum range boosts to make server power non-decreasingCodingYou manage a row of n machines. Machine i has an integer capacity poweri. You want the capacities to be non-decreasing from left to right (poweri <= poweri+1 for every i). You may…
    Last asked Mar 2026
  • Web-scale crawl cleaning for pretraining dataSystem designDesign a staged batch pipeline that turns raw web crawl into a deduplicated, quality-filtered, decontaminated pretraining corpus on a fixed cluster and deadline. Reported on…
    Last asked Mar 2026
  • Group anagramsCodingGroup the words in a list that are anagrams of one another, keeping repeated words. Build the grouping key from letter counts instead of sorting each word.
    Last asked Mar 2026
  • Max area of islandCodingGiven a binary matrix, return the area of the largest island: a group of 1 cells connected up, down, left or right (diagonals don't connect).
    Last asked Mar 2026
  • Number of islandsCodingGiven a binary matrix, return how many islands it has: groups of 1 cells connected up, down, left or right (diagonals don't connect).
    Last asked Mar 2026
  • Breadth-first web crawler with retriesCodingIn your own IDE, write a crawler that walks a given website breadth-first from a start URL, normalizing URLs and retrying requests that fail. API docs are allowed; AI tools are…
    Last asked Mar 2026
  • Squirrel carrying nuts to a treeCodingA squirrel, a tree and several nuts are on a grid. The squirrel carries one nut at a time to the tree, moving one cell up, down, left or right per step. Return the fewest moves to…
    Last asked Mar 2026
  • Message latency from send and receive logsCodingTwo CSV files describe messages between two machines: one lists when machine A sent each message, the other when machine B received it. Match the rows by message and compute each…
    Last asked Mar 2026
  • Unique Morse code wordsCodingTranslate each word into Morse code by joining the codes of its letters, and return how many different translations there are.
    Last asked Feb 2026
  • Worker hours registerCodingImplement a register that records the hours workers log and answers questions about each worker's totals.
    Last asked Feb 2026
  • Merge two sorted arrays in placeCodingTwo integer arrays, arr1 and arr2, are each sorted in ascending order. Merge arr2 into arr1 without using another array, so that arr1 ends up holding all the values, still…
    Last asked Feb 2026
  • Word breakCodingReturn whether a string can be split into a sequence of words from a dictionary, where words may be reused. Give the dynamic programming solution and its cost.
    Last asked Feb 2026
  • Design a multi-provider financial dashboardSystem designDesign a dashboard that shows each user financial metrics such as account balances and stock holdings. The data comes from several external providers, such as stock data feeds…
    Last asked Feb 2026
  • Extensible employee cost calculatorOO designDesign the classes for a calculator that works out what employees cost the company. Different kinds of employees are costed differently, and new kinds or cost components will be…
    Last asked Feb 2026
  • Weighted 01 and 10 subsequence pairs with wildcardsCodingA status string holds '0', '1' and '!'. Every pair of positions i < j that reads 0 then 1 (a subsequence, not a substring) costs x, and every pair that reads 1 then 0 costs y…
    Last asked Jan 2026
  • Database internals: WAL, MVCC, replication and recoveryCodingExplain the internals a relational database relies on: write-ahead logging and why it makes commits durable, multi-version concurrency control and how readers avoid blocking…
    Last asked Jan 2026
  • Design a cloud database's write path and crash recoverySystem designDesign how writes flow through a managed cloud relational database: from a client's commit to durable storage, how the data is replicated across machines or zones, and how the…
    Last asked Jan 2026
  • Design a computer-use agentAI systemDesign an agent that operates a computer the way a person does: it looks at the screen, decides the next action and clicks or types until a task is done. Cover how the model…
    Last asked Jan 2026
  • Find when failures started in a logCodingA service writes a time-ordered log of request results, and at some point it started failing. Find the moment the failures began. Discuss the approach when you can only read the…
    Last asked Jan 2026
  • Inheritance, polymorphism, constructors and destructorsCodingExplain the difference between inheritance and polymorphism, then write a short example in which a child class overrides a method of its parent. Next, compare constructors and…
    Last asked Jan 2026
  • Print the odd numbers in a listCodingGiven a list of integers, print every odd number in it, in order. Mind negative numbers and an empty list.
    Last asked Jan 2026
  • Responsive grid of fixed-size boxesCodingBuild a web page that lays out fixed-size boxes in a grid that reflows as the window gets wider or narrower: as many boxes per row as fit, wrapping to new rows. Explain the CSS…
    Last asked Jan 2026
  • Serialize and deserialize a binary treeCodingTurn a binary tree into a string and rebuild the identical tree from that string. Choose a format (pre-order with null markers, or level order), handle empty trees and negative…
    Last asked Jan 2026
  • Word break II: every way to split a sentenceCodingGiven a string and a dictionary of words, return every sentence you can form by splitting the string into dictionary words, with words separated by spaces. Words may be reused…
    Last asked Jan 2026
  • Fewest conflicts when merging branchesCodingSeveral branches have to be merged, and the order of the merges changes how many commit conflicts come up. Given the branches and how conflicts arise between them, return the…
    Last asked Jan 2026
  • Robot charging controller with exclusive stationsCodingA fleet of robots shares a small number of charging stations. A robot whose battery drops below 50% should go to a free station, and a robot charging above 95% may leave and go…
    Last asked Jan 2026
  • Fewest emergency restocks to keep inventory validCodingYour stock changes every day by taski (positive or negative). On days where taski == 0 the stock is checked and must not be negative, and at no time may the stock exceed…
    Last asked Jan 2026
  • H-index of instance ratingsCodingGiven the integer ratings of a set of instances, return the largest integer k such that at least k instances have a rating of k or more (return 0 when no such k exists). Do it…
    Last asked Jan 2026
  • Pair servers as primary and backup to maximize memoryCodingEach server has a memory size. Choose servers and group them into pairs, each pair a primary and a backup, where the backup must be able to take over for its primary (its memory…
    Last asked Jan 2026
  • Product of array except selfCodingReturn an array where each position holds the product of every other element, without division and in linear time, using prefix and suffix products; then do it with constant extra…
    Last asked Jan 2026
  • Critique a design doc from the team's backlogSystem designThe interviewer hands over a real design doc and asks for a critique: surface risks, propose alternatives, and say what is missing before this could ship.
    Last asked Jan 2026
  • Debug a model that does worse online than offlineML designA model scored well in offline evaluation, but after launch its online metrics are worse. How do you find out why? Walk through the likely causes (training-serving skew in…
    Last asked Jan 2026
  • Design a globally consistent metadata serviceSystem designDesign a metadata service that stays strongly consistent across regions: every read reflects the latest committed write wherever it is served. Cover the data model, how writes are…
    Last asked Jan 2026
  • Design a personalized search ranking systemML designRank search results for each user's query and context so they find and book (or order) what they want, learning from clicks and conversions.
    Last asked Jan 2026
  • Design a real-time temperature monitoring systemSystem designCollect readings from millions of sensors every few seconds, show live and historical temperatures, and alert when a sensor goes out of range or silent.
    Last asked Jan 2026
  • Weighted random value generatorCodingGiven values with positive weights, write a generator that returns a value at random with probability proportional to its weight. Build it once and answer many calls quickly, and…
    Last asked Jan 2026
  • Design Amazon Locker (object-oriented)OO designModel a locker location with compartments of several sizes: assign a package to a compartment that fits, issue a pickup code, and handle expiry and returns.
    Last asked Jan 2026
  • Implement memcpy with misaligned addressesCodingWrite memcpy: copy n bytes from a source address to a destination address. Copying one byte at a time is slow, so copy in machine words, and handle source and destination pointers…
    Last asked Jan 2026
  • Design a package installer with dependenciesSystem designDesign a package installer: a user asks for a package and the installer fetches it together with everything it depends on, in a valid order. Cover how dependencies and versions…
    Last asked Jan 2026
  • Design Amazon Kindle (object-oriented)OO designModel an e-reader library: buy and download books, keep several formats, track reading position across devices, and support highlights.
    Last asked Jan 2026
  • Top k lottery winners by spendingCodingGiven lottery entries that record who bought tickets and how much they spent, return the top k people ranked by total spending. Discuss ties and how you would keep the answer…
    Last asked Jan 2026
  • Vertical order traversal of a binary treeCodingGive every node of a binary tree a column (root at 0, left child one less, right child one more) and a row. Return the node values column by column from left to right, top to…
    Last asked Jan 2026
  • Implement k-means clusteringCodingImplement k-means from scratch: initialize k centroids, assign every point to its nearest centroid, move each centroid to the mean of its points, and repeat until the assignments…
    Last asked Dec 2025
  • Linear regression with hand-written gradient descentCodingFit a one-feature linear regression by gradient descent on mean squared error, without an ML library. Then discuss choosing the learning rate, when to stop, and how to spot a…
    Last asked Dec 2025
  • Word ladderCodingGiven a start word, an end word and a word list, find the length of the shortest sequence from start to end in which each step changes exactly one letter and every word after the…
    Last asked Dec 2025
  • Shortest path in a grid with obstaclesCodingGiven a 2D grid where some cells are blocked, find the length of the shortest path from the top-left cell to the bottom-right cell moving up, down, left or right, or return -1 if…
    Last asked Dec 2025
  • Design an LLM output quality validation systemAI systemDesign a system that checks the quality of a language model's answers before and after they reach users. Cover what "quality" means for the product, automatic checks and…
    Last asked Dec 2025
  • Design an S3-like object storage systemSystem designStore trillions of objects of any size with eleven nines of durability, and serve reads and writes over an HTTP API at high throughput.
    Last asked Dec 2025
  • Divide two integers without divisionCodingDivide two integers without using multiplication, division or the modulo operator, truncating toward zero. Do better than subtracting the divisor one copy at a time by doubling it…
    Last asked Dec 2025
  • Floating-point formats for training and an ablation studyML designCompare the floating-point formats used to train and run models (FP32, FP16, BF16, FP8 and others): range, precision, speed and when each is a good choice. How would you detect…
    Last asked Dec 2025
  • Tensor parallelism versus pipeline parallelismML designA transformer is too big for one accelerator. Explain how tensor parallelism and pipeline parallelism each split it: what is cut, what crosses the wire and when, where the idle…
    Last asked Dec 2025
  • Write a PyTorch training loopCodingWrite a training loop in PyTorch from scratch: build the data loader, run the forward pass, compute the loss, back-propagate, step the optimizer, and evaluate on held-out data…
    Last asked Dec 2025
  • Parking lot occupancy peaks from entry and exit eventsCodingYou get parking events carid, time, 'entry' 'exit', not necessarily in order. 1. What is the largest number of cars that were in the lot at the same time? 2. Return the time…
    Last asked Dec 2025
  • Design a hash map without built-in librariesCodingImplement a hash map with put, get and remove without using any built-in hash table. Choose the bucket layout, the hash function and how collisions are handled, and explain when…
    Last asked Nov 2025
  • Design a logo infringement detection systemML designDesign a machine-learning system that finds listings or images that misuse a brand's logo. Cover how brands register their logos, how you detect and match logos in new images at…
    Last asked Nov 2025
  • Implement a decoder-only GPT modelCodingWrite a small decoder-only transformer from scratch as four classes: multi-head self-attention with a causal mask, the feed-forward block, a decoder layer that combines them with…
    Last asked Nov 2025
  • LFU cache, then distribute itCodingDesign and implement a least-frequently-used cache with get and put in O(1), evicting the least used key and, among ties, the least recently used. The input then becomes a stream…
    Last asked Nov 2025
  • Design an online Minesweeper platformSystem designDesign a platform where people play Minesweeper online. Cover generating boards, the API for revealing and flagging cells, where game state lives and who is trusted to know mine…
    Last asked Nov 2025
  • Design a basic credit card systemOO designDesign the classes for a simple credit card system: cards and accounts, a credit limit, purchases, payments and the balance. Show how a purchase is authorized against the limit…
    Last asked Oct 2025
  • Design an elevator control systemOO designModel a bank of elevators: hall and car requests, a dispatching strategy, direction and door states, and capacity limits.
    Last asked Oct 2025
  • Design InstagramSystem designUsers post photos and videos, follow each other and scroll a feed; design upload, storage, feed generation and serving media worldwide.
    Last asked Oct 2025
  • Look up a value in a nested object by pathCodingGiven a nested object (maps and lists inside each other) and a path string such as a.b.0.c, return the value at that path, or a default when any step is missing. Handle list…
    Last asked Oct 2025
  • Products your friends bought that you haven'tCodingA user has a list of friends and a list of purchases; each purchase has a product id, an amount and a purchase id, and a product catalog maps product ids to names. Return the…
    Last asked Oct 2025
  • Reusable dialog componentCodingBuild a reusable dialog component for a web page. It takes a background color, a title, a close button and a list of action buttons from the caller. Make it reusable across pages…
    Last asked Oct 2025
  • Detect a cycle in a directed graphCodingDecide whether a directed graph contains a cycle, using depth-first search with node states or Kahn's topological sort. Variants that came up: start with a linked list (fast and…
    Last asked Oct 2025
  • Cells water reaches flowing downhillCodingA 2D map gives the height of each cell. A drop of water lands on one cell and flows to neighbouring cells (up, down, left, right) whose height is not greater than the cell it is…
    Last asked Oct 2025
  • Can repeated pair additions reach a target pointCodingFrom a starting point (x, y) you may move to (x + y, y) or (x, x + y). Decide whether a target point is reachable, efficiently even for very large coordinates.
    Possibly retired
  • Earliest time a password becomes irrecoverableCodingA password is attacked one character at a time: you get the order in which positions are replaced by '', one per second. The password counts as irrecoverable once at least m of…
    Possibly retired
  • Longest subarray whose ends exceed everything betweenCodingGiven an integer array, return the length of the longest contiguous subarray whose first and last elements are both greater than every element strictly between them. Do better…
    Possibly retired
  • Memory usage switcher with configurable thresholdsOO designDesign and code an in-memory switcher that watches memory usage and switches between states (or targets) when usage crosses thresholds the caller can configure. Cover how…
    Possibly retired
  • Report a user's license usage from a log fileCodingWrite a command-line script called as ./script.sh <username <logfile. Each log line looks like timestamp license user@hostname. Print the result the interviewer asks for about…
    Possibly retired
  • Root-started value path in an N-ary treeCodingYou are given the root of an N-ary tree (each node has an integer val and a list of children) and a list of integers path. Return true if there is a downward path that starts at…
    Possibly retired
  • Sort characters by frequencyCodingGiven a string, rearrange it so the most frequent characters come first, each character's copies kept together. Count with a hash map, then sort or bucket by count.
    Possibly retired
  • Task delay times from the farthest smaller priorityCodingTask priorities are given in an array and processed from right to left. A task's delay time is the distance from it to the farthest task on its right that has a smaller priority…
    Possibly retired
  • Unique visitors per department from click logsCodingEach product has an id, a department, a category and a subcategory; the last three form a parent-child hierarchy. A click log records (customerid, productid). For any department…
    Possibly retired
  • Unload warehouses in turns with limited skipsCodingYou and a co-worker empty warehouses one at a time; warehouse i holds ci items. You take turns: you remove m items per turn and your co-worker removes n. You earn a point for a…
    Possibly retired
  • Autocomplete with top-k suggestionsCodingGiven a list of past queries with their counts, build an autocomplete: for a prefix the user has typed, return the k most popular completions. Use a trie, and discuss storing top…
    Possibly retired
  • Configuration store with subscriber notificationsOO designDesign classes that let a system set configuration values while applications subscribe to the settings they care about. When a value changes, every subscriber of that setting is…
    Possibly retired
  • Debounce and throttle in JavaScriptCodingImplement debounce(fn, wait) and throttle(fn, wait) in JavaScript. Keep this and the arguments of the latest call, support cancelling, and discuss options to fire on the leading…
    Possibly retired
  • Design a basic task management systemSystem designDesign a simple task management system: users create tasks, assign them, set due dates and statuses, and see their lists. Cover the API, the data model, notifications for due…
    Possibly retired
  • Design a multimodal neural networkML designDesign a neural network that takes several kinds of input at once, such as text and images. Explain how each input is encoded, where and how the modalities are fused (early, late…
    Possibly retired
  • Design a RAG system end to endAI systemDesign a retrieval-augmented generation system from documents to answers: ingesting and chunking documents, embeddings and the index, retrieval and reranking, the prompt to the…
    Possibly retired
  • Design a risk management ticketing systemSystem designDesign a ticketing system that a security and risk team uses to track risks: open a ticket, assign an owner, set severity and deadlines, escalate when it is overdue, and close it…
    Possibly retired
  • Design a top-K popular items systemSystem designReport the K most viewed or played items over sliding windows (last minute, hour, day) from a firehose of billions of events per day.
    Possibly retired
  • Design a traffic light control systemOO designModel an intersection's traffic lights with phases and timings, pedestrian requests and an emergency override, as a clear state machine.
    Possibly retired
  • Design an e-commerce recommendation systemML designDesign the system that recommends products to shoppers on an e-commerce site. Cover candidate generation, ranking features and model, training data from views and purchases, cold…
    Possibly retired
  • Design TinyURLSystem designTurn long URLs into short links and redirect visitors fast, at billions of redirects a day, with optional custom aliases and expiry.
    Possibly retired
  • Diameter of a binary treeCodingReturn the number of edges on the longest path between any two nodes of a binary tree. The path need not pass through the root. Solve it in one pass.
    Possibly retired
  • Extensible event ticketing systemOO designWrite an EventTicketSystem that sells tickets for different kinds of events, such as concerts, movies and sports games. Adding a new kind of event later should not require…
    Possibly retired
  • Filter and analyze logs with an object-oriented designOO designDesign classes that read a stream of log entries, some of them errors, filter them by rules such as level, time range or source, and report simple analytics such as error counts…
    Possibly retired
  • Fixed-capacity circular bufferCodingImplement a generic FIFO buffer with a fixed capacity, allocated once up front, with constant-time push and pop. Discuss how to signal full and empty and how the buffer would be…
    Possibly retired
  • Fleet capacity after server id replacementsCodingA service runs on a fleet of n servers. Each server has an integer id, and a server with id x can handle x requests at a time. The fleet's total capacity is the sum of all server…
    Possibly retired
  • Insert intervalCodingGiven a list of non-overlapping intervals sorted by start and a new interval, insert the new one and merge wherever it overlaps, returning a sorted list of non-overlapping…
    Possibly retired
  • Keyboard and mouse input systemOO designDesign classes for an input system that records what a user does with the keyboard and the mouse (key presses, clicks, movement) so that the program can tell what was input…
    Possibly retired
  • Longest common contiguous subarrayCodingGiven two integer arrays, return the length of the longest run of values that appears contiguously in both. Start with dynamic programming, then discuss reducing the memory or…
    Possibly retired
  • Lower and upper bound binary searchCodingGiven an array sorted in non-decreasing order and a target, return the first index whose value is at least the target and the first index whose value is greater than the target…
    Possibly retired
  • Most distinct values of B[i] mod A[i]CodingYou get an array A of n positive integers. You choose any array B of length n, and compute Bi % Ai for every i. Return the largest possible number of distinct values among these…
    Possibly retired
  • Most optional tasks under a daily time limitCodingEach day has the same time limit. Every day must run its required task; if time allows, it can also run one optional task. You get n required durations (one per day) and n…
    Possibly retired
  • Order jumps between blocks to burn the most caloriesCodingYou stand on the ground (height 0) next to n blocks of given heights. You must jump onto every block exactly once, in any order, and you never return to the ground. A jump from…
    Possibly retired
  • Price rides with fairness and poolingSystem designWrite and design the pricing logic of a ride-hailing service: compute a fare from distance, time and demand, keep prices fair between riders, and price pooled rides where several…
    Possibly retired
  • Real-time top-k products from purchase eventsCodingPurchase events (customerid, itemid, timestamp) arrive continuously. Keep a structure that returns the k most purchased items at any moment. Discuss the cost of updates and…
    Possibly retired
  • Search a sorted array of unknown lengthCodingA sorted array can only be read through get(i), which signals when i is past the end; you do not know the length. Return the index of a target value or -1. Find a range that…
    Possibly retired
  • Design a GitHub-like developer communitySystem designDesign the user-facing community side of a GitHub-like site: profiles, following people and repositories, stars, activity feeds and notifications. The interviewer stressed very…
    Possibly retired
  • Design a restaurant reservation serviceOO designModel restaurants, tables, time slots and reservations: search availability, book, modify and cancel, and avoid double-booking a table.
    Possibly retired
  • Shortest unsorted continuous subarrayCodingFind the shortest contiguous subarray that, if sorted, makes the whole array sorted, and return its length. Start from sorting a copy, then find an O(n) two-pointer solution.
    Possibly retired
  • Design Unix file searchOO designModel a find-like file search over a directory tree with composable filters (name pattern, size, type, extension) that are easy to extend.
    Possibly retired
  • Left and right views of a binary treeCodingReturn the left view of a binary tree (the first node seen at each level from the left) and the right view (the last node at each level). Write it with breadth-first search, then…
    Possibly retired
  • Most equal values after shifting one subarrayCodingGiven an array, you may once choose any contiguous subarray and add the same integer (positive or negative) to all of its elements. Return the largest number of equal values the…
    Possibly retired
  • Design a payment fraud detection systemML designScore every card payment for fraud within tens of milliseconds, balancing blocked fraud against declined good customers, with labels that arrive weeks later.
    Possibly retired
  • Design an email spam detection systemML designDesign a system that flags spam email before it reaches the inbox. Cover the features (content, sender, links, behavior), the model, labels from user reports, adversaries who…
    Possibly retired
  • Lock, unlock and upgrade nodes in a treeCodingA tree is given by a parent array. Implement lock(node, user), unlock(node, user) and upgrade(node, user): a node can be locked by a user if it is unlocked; unlocked only by the…
    Possibly retired
  • Most tasks finished before their deadlinesCodingGiven tasks with durations and deadlines, run them one at a time and choose as many as possible so that each finishes by its deadline. Return how many. Sort by deadline and use a…
    Possibly retired
  • Place items into the earliest bin that fitsCodingBins have capacities and items arrive in order. Put each item into the first bin, from left to right, that still has room for it. Return where each item goes. Do better than…
    Possibly retired
  • Time-series manipulation with pandas groupbyCodingGiven a pandas DataFrame of timestamped records, answer questions with groupby: aggregate per group and time period, resample, and compute rolling or cumulative values. Explain…
    Possibly retired
  • Find the number that appears an odd number of timesCodingIn an integer array exactly one value appears an odd number of times. Return it. A hash map is fine at first; the follow-up asks for O(1) extra space, which XOR gives.
    Possibly retired
  • LRU cacheCodingBuild a key-value cache with a fixed capacity that evicts the least recently used entry when it is full. get(key) returns the value or a miss, put(key, value) inserts or updates…
    Possibly retired
  • Valid Sudoku in one passCodingDecide whether a partly filled 9x9 Sudoku board is valid: no digit repeats in any row, column or 3x3 box (empty cells are ignored). Check it in a single pass over the board.
    Possibly retired
  • Design a feature flag serviceSystem designLet teams turn features on for a percentage of users or specific accounts, with changes reaching every service within seconds and no per-request network call.
    Possibly retired
  • Target sumCodingPut a + or - in front of every number in an array and count how many ways the expression adds up to a target. Write the recursive solution, then turn it into a dynamic program…
    Possibly retired
  • Best locker location on a grid with obstaclesCodingOn a grid with obstacles, choose an empty cell for a locker so that the total walking distance to it from a set of given locations is as small as possible, walking around…
    Possibly retired
  • Delayed job schedulerOO designDesign and code a scheduler that accepts a job and a delay and runs the job after that many seconds. Cover the data structure that finds the next due job, the worker thread or…
    Possibly retired
  • Design DropboxSystem designSync files across a user's devices and shared folders: upload large files reliably, transfer only what changed, and handle conflicting edits.
    Possibly retired
  • Reach a destination by bus with limited walkingCodingYou get start and end points on a grid, a walking budget k, and bus routes between pairs of stations, all two-way. Riding a bus costs no walking; walking between points costs…
    Possibly retired
  • Thread-safe document and tag classesOO designDesign classes that record documents and the tags on them: add and remove tags, list a document's tags, and find documents by tag. Follow-up: many threads use it at once; make it…
    Possibly retired
  • Maximum sum of a length-k subarrayCodingUse a sliding window to find the largest sum of any contiguous subarray of length k, and explain its time and space. The same round followed with a heap problem.
    Possibly retired
  • Design an ad click aggregation systemSystem designCount ad clicks per ad and per time window from billions of events a day, accurately enough to bill advertisers, with results available within minutes.
    Possibly retired
  • Design an online bookstoreSystem designBrowse and search a catalog, keep a cart, check out and track orders, without overselling limited stock.
    Possibly retired
  • Rotting orangesCodingIn a grid, cells are empty, fresh fruit or rotten fruit. Each minute, fresh fruit next to rotten fruit (up, down, left, right) rots. Return the minutes until no fresh fruit is…
    Possibly retired
  • Substring with concatenation of all wordsCodingGiven a string and a list of words of equal length, return every start index where a substring is some concatenation of all the words, each used exactly once. Use a sliding window…
    Possibly retired
  • Top-k clicked items over a rolling windowCodingClick events arrive with timestamps. Keep the k most clicked items over the last fixed window of time, evicting old clicks as time moves on. Follow-ups asked about optimizing it…
    Possibly retired
  • Fewest passes to collect a permutation in orderCodingA shelf holds a permutation of 1..n. Starting with target 1, you scan the shelf left to right, and whenever you see the current target you take it and look for the next number…
    Possibly retired
  • Basic calculator IICodingEvaluate a string expression of non-negative integers with +, -, , / and spaces, no parentheses, respecting precedence (integer division truncates toward zero). Variants reported:…
    Possibly retired
  • Cheapest way to make product sizes distinctCodingProducts have sizes sizei, and raising product i's size by one costs costi. Sizes may only grow. Return the least total cost to make all sizes distinct. The same screen also had a…
    Possibly retired
  • Count of smaller numbers after selfCodingFor every element of an integer array, count how many elements to its right are smaller, and return those counts. The O(n^2) scan is too slow; use merge sort that tracks original…
    Possibly retired
  • Most days picking distinct productsCodingYou have quantities of several products. On day i (starting at 1) you must pick exactly i items, each from a different product, out of what is left. Return the largest number of…
    Possibly retired
  • Most frequent user in access logsCodingEach log entry is a string holding a username and an access timestamp. Return the user who appears most often. Discuss ties, malformed lines and logs too big for memory.
    Possibly retired
  • End-to-end ML coding: from raw data to predictionsML designA hiring-manager problem-solving round: given a simplified dataset for a business problem, write the whole pipeline in code. Clean and process the data, engineer features…
    Possibly retired
  • Inventory allocation with backordersCodingOrders arrive for products whose stock is limited. Allocate stock to orders as they come in; when a product runs out, record the unfilled part as a backorder and fill backorders…
    Possibly retired
  • Design a parking lotOO designModel a multi-floor parking lot with spot types for motorcycles, cars and trucks: park, unpark, find free spots, and charge by time.
    Possibly retired
  • Fewest intervals to remove so one covers the restCodingGiven a list of intervals, remove as few as possible so that among the remaining intervals at least one covers all the others. Return how many you remove.
    Possibly retired
  • First unique character in a stringCodingReturn the index of the first character in a string that appears only once, or -1 if every character repeats. Do it in two passes with a count table.
    Possibly retired
  • Make sure every cluster job completesSystem designA company runs many jobs on a high-performance cluster and needs a service that makes sure every one of them completes. You get two functions (for example, one that starts a job…
    Possibly retired
  • Design pickup point planning for ride-hailingSystem designDesign how a ride-hailing app suggests where a rider should be picked up: candidate points near the rider, ranking them by walking distance, road access, and driver arrival time…
    Possibly retired
  • Music player that plays the most frequent unplayed songCodingUsers keep arriving, each with a list of songs, and every song's count goes up each time it appears. The player must always play the most frequent song that has not been played…
    Possibly retired
  • Best k-day run in a cyclic sprint scheduleCodingA training program is made of n back-to-back sprints. Sprint i lasts daysi days. On day j of a sprint (counting from 1 within that sprint), finishing that day's work earns j…
  • Cake order fulfillment checkCodingA bakery keeps three kinds of cake. Its stock is an array stock of length 3, where stocki is how many cakes of type i are on hand. Orders arrive one at a time in the list orders…
  • Compress an n-ary tree by promoting childrenCodingEach node of an n-ary tree holds a unique integer value and an ordered list of children. You are given the root and a list compressednodes of values. Implement compress(root…
  • Connect points that share a row or columnCodingDesign a structure over an unbounded 2D grid. Each cell is either empty or holds a point. You can move from one point to another point in one step when the two points share a row…
  • Count reverse-complement DNA strand pairsCodingYou are given a list of DNA strands. Each strand is a non-empty string over the alphabet A, C, G, T. The reverse complement of a strand is formed by reversing it and then…
  • Count warehouse robots boxed in on all four sidesCodingA warehouse floor is modeled as an integer grid. Each delivery robot sits at a point (xi, yi), and no two robots share a point. A robot is idle when there is at least one other…
  • Days needed to finish recurring tasksCodingYou run n recurring tasks. Task i runs for the first time on day 1 and then again every intervalsi days, so it runs on days 1, 1 + intervalsi, 1 + 2 intervalsi, .... Any number of…
  • Design a blackjack gameOO designModel a blackjack table with a dealer, players, a shoe of decks, bets, hit/stand/double/split, and payouts.
  • Design a bot detection systemML designSeparate automated traffic from real users on a large website, in real time, while bots adapt to whatever you deploy.
  • Design a chess gameOO designModel a two-player chess game: board, pieces and their moves, turns, check, checkmate and stalemate, and special moves like castling.
  • Design a coffee makerOO designModel a coffee machine with recipes, ingredient containers and brewing steps; refuse drinks when ingredients run low and make adding recipes easy.
  • Design a distributed key-value storeSystem designStore and serve billions of keys with low latency, partitioned across machines and replicated to survive failures, with tunable consistency.
  • Design a driver location heatmapSystem designShow near-real-time density of available drivers and rider demand on a city map, updated every few seconds from millions of location pings.
  • Design a hotel booking systemSystem designSearch hotels by place and dates, show availability and prices, and book rooms without double-booking, including holds and cancellations.
  • Design a quota serviceSystem designTrack and enforce how much of each resource (API calls, storage, compute) every tenant may use, with fast checks and limits that stay accurate across regions.
  • Design a rate limiterSystem designDesign a service that limits how many requests each API client can make. It sits in front of every API endpoint at high traffic.
  • Design a real-time air traffic control systemSystem designTrack every aircraft in a region from radar and transponder feeds, predict conflicts, and alert controllers within a second, with no single point of failure.
  • Design a vending machineOO designModel a vending machine with products, slots, coins and notes: select, pay, give change and handle sold-out items, using clear states.
  • Design a VM bandwidth rate limiterSystem designCap the network bandwidth each virtual machine in a cloud region may use, enforcing per-tenant limits across many hosts without adding latency to packets.
  • Design a voting systemOO designModel polls with options, voters and ballots: cast one vote per voter, change it before closing, and tally results.
  • Design an address autofill systemML designAs a user types an address, suggest the full, valid address they mean, ranked by likelihood and personalized by location and history.
  • Design an ATMOO designModel an ATM: card and PIN authentication, balance inquiry, withdrawal with a cash dispenser of fixed denominations, deposit, and failure handling.
  • Design ChatGPTAI systemDesign a consumer chat product backed by a large language model: conversations, streamed replies, history across devices, at 100M weekly users.
  • Design tic-tac-toeOO designModel an N-by-N tic-tac-toe game for two players: moves, turn order, and detecting a win or draw efficiently after each move.
  • Design typeahead suggestionsSystem designSuggest completions as the user types into a search box, within tens of milliseconds, ranked by popularity and fresh with trending queries.
  • Design YouTubeSystem designUpload videos, transcode them into many formats, and stream them worldwide with adaptive bitrate, along with views, likes and comments.
  • Detect disguised abusive words in commentsCodingA comment platform wants to catch abusive words that users disguise with look-alike characters, such as $ for s or 0 for o. Implement AbuseDetector: - AbuseDetector(banned…
  • Disk block writes with limited write cyclesCodingA storage device has n blocks with ids 0 to n - 1. Every block can be written at most maxcycles times; after that it is worn out and can never be written again. Implement a…
  • Fewest append-to-end moves to reverse a binary imageCodingAn image is stored as a binary string s: '1' is a white pixel and '0' is a black pixel. To make a backup, you want to turn s into its reverse, s read from right to left. You may…
  • Fit the most tasks into an hour across machine slotsCodingYour team runs a batch cluster of n machines with IDs 0 to n-1. Each machine has m execution slots, so it can run up to m tasks at the same time. A slot runs one task at a time;…
  • Frequent user events within a 24-hour windowCodingYou are given a list of activity log entries. Each entry has a userid (string), a timestamp (integer seconds since epoch) and an eventtype (string). The list is not sorted…
  • Insert plus, times and parentheses to reach a targetCodingYou are given an equation whose left side is a sequence of non-negative integers with no operators between them, and whose right side is a target. For example: 2 3 4 = 20. Insert…
  • Largest value shared by two BSTsCodingYou are given the roots of two binary search trees, a and b, holding integer values. Return the largest integer that appears in both trees. If the trees share no value, return -1…
  • Longest path in a DAG from an edge listCodingYou are given a directed acyclic graph as a list of edges. Each edge is a pair u, v of node names and means there is an edge from u to v. A node exists only if it appears in at…
  • Maximize minus signs with positive prefix sumsCodingYou are given a list of positive integers nums = a1, a2, ..., an. Put a sign, + or -, in front of each number. Keep the order. After each position i, the running total of the…
  • Maximum combination health of AI modulesCodingA lab is assembling an AI system from n candidate modules. Module i has a health healthi (how much it contributes) and a stability stabilityi (how reliable it is). Both are…
  • Maximum stability of a server groupCodingA cloud provider offers n servers. Server i has two positive integer scores: reliabilityi and availabilityi. A client deploys on any non-empty group of servers. A group is only as…
  • Meeting room scheduler over a fixed set of roomsCodingImplement a MeetingScheduler for a fixed set of meeting rooms. Each room has a unique string ID. - MeetingScheduler(roomids: liststr) sets up the rooms. Room IDs are unique. -…
  • Minimum daily reading pace to finish a textbookCodingA student must read a textbook of n chapters before an exam. Chapter i has pagesi pages, and the chapters must be read in order. The student picks a daily limit x. On each day…
  • Minimum starting battery for a task queueCodingA server runs a queue of jobs strictly in order, powered by one battery. Job i changes the battery by -usagei: a positive usagei drains the battery, and a negative one means the…
  • Pascal triangle digit encryptionCodingDigits are encrypted by folding them down an upside-down Pascal's triangle. You get a list of n digits (each 0-9). In one round, replace the list with the sums of each pair of…
  • Password similarity under cyclic character bumpsCodingA security team wants to reject a new password when it is too close to the user's previous one. You may transform the new password like this: pick any set of its positions…
  • Place books on the least-full allowed shelfCodingYou have numshelves shelves, numbered 0 to numshelves - 1. All shelves start empty. Books arrive one at a time. Book i comes with a limit limitsi. It may only go on shelves 0…
  • Process queue with wait limitsCodingA single server works through a line of n processes in first-in, first-out order. Process i (0-indexed, in line order) can wait at most waiti seconds. Once that much time has…
  • Regex matcher with starred groupsCodingImplement a small regex engine for a text-processing pipeline. Write ismatch(s: str, pattern: str) - bool. It returns True only when the whole string s matches pattern. The…
  • Remove items so any k prices stay under a thresholdCodingA store is planning a holiday promotion from a list of candidate items with known prices. Shoppers may pick any k items from whatever stays on the list, and the store wants every…
  • Route a request along diagonal server redirectsCodingServers sit at distinct integer points on an infinite 2D grid. locationsi = x, y is the position of server i. A request starts at server 0, which counts as visited. You are given…
  • Smallest free hub for a taskCodingYou run a fleet of n compute hubs, numbered 0 to n - 1, and need to place one new task on a single hub. You are given: - capacities: an integer list of length n. capacitiesi is…
  • Sort words by a custom alphabetCodingYou are given a string order that lists characters from first to last in a custom alphabet. Each character appears in order at most once. You are also given a list of strings…
  • Split parcels into the most balanced shipmentsCodingParcels sit on a conveyor in a fixed order, and weightsi is the weight of the i-th parcel. You must cut the line into contiguous shipments so that every parcel belongs to exactly…
  • Two-player card game simulationCodingYou are building the engine for a simple two-player card game. Players are named "A" and "B". The deck is a list of distinct integers, and a higher integer beats a lower one…