Usually two rounds; one is often an object-oriented design built in steps
They grade
Clarifying an under-specified prompt, clean class design, compilable code, edge cases
AI use
No AI
Heads-up
Every round also asks Leadership Principles questions.
Questions Amazon asks in this round 136
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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…
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
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
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
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
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
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 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
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…
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
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
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
Searchable sentence indexCodingBuild an index over a collection of sentences so you can quickly find the sentences that contain given words.
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
Worker hours registerCodingImplement a register that records the hours workers log and answers questions about each worker's totals.
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
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 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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
Remove k consecutive machines to minimize strength differencesCodingMachines stand in a row, each with a strength. Remove exactly k consecutive machines so that the sum of absolute differences between neighbouring strengths in the remaining row is…
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
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
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
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
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
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 distinct passwords from one substring reversalCodingA security team scores a password by its variability. Variability is the number of distinct strings you can get by reversing exactly one contiguous substring of the password…
Count redundant substrings by vowel and consonant weightsCodingWrite a function that counts the redundant substrings of a word. A string s is redundant when its length equals a V + b C, where V is the number of vowels in s, C is the number of…
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 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 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 voting systemOO designModel polls with options, voters and ballots: cast one vote per voter, change it before closing, and tally results.
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 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.
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…
Fewest decrements to make an array a 1-to-k-to-1 pyramidCodingYou are given an array arr of n non-negative integers. One operation picks any index and lowers that element by exactly 1. Elements can never be raised. Return the minimum number…
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…
Maximize total cluster throughput from median-of-three serversCodingYou manage a fleet of host servers. hostThroughputi is the throughput of server i (a non-negative integer). Group servers into clusters of exactly three distinct servers. Build as…
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 cost to clear a binary array with k-wide windowsCodingA packaging line tracks a row of n units, each built as one of two variants: variant A is written 0 and variant B is written 1. You need to convert every unit to variant A. You…
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…
Smallest palindrome from a symmetric string's lettersCodingYou are given a string s of lowercase English letters that is already a palindrome. Rearrange all of its characters to form a new palindrome, and return the one that comes first…
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…
Spell a word with letter blocks, one block per letterCodingYou have a set of letter blocks. Each block is a list of lowercase characters printed on its faces. You also get a target string. Implement canform(blocks: listliststr, target:…
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…
Question types
Amazon coding interview: questions and format · Land the Lab