Interview blog

Amazon LeetCode Interview Questions: What Amazon Tests

Written April 30, 2026Updated November 10, 202611 min read
pexels mikhail nilov 7682106

Amazon has no official LeetCode list, but its own prep videos show a real practice question that maps to LeetCode 1268. What it tests, and a plan.

Amazon doesn't publish a list of LeetCode questions, so the "most asked" lists for Amazon you find online are not official. Amazon does publish something more useful: prep pages for SDE II, SDE III and university roles, and a set of videos in which its own engineers solve sample coding questions. One of those samples is, almost word for word, LeetCode 1268, Search Suggestions System, with two extra requirements added. The videos also name the algorithms and data structures to expect: tree traversal, greedy algorithms, dynamic programming and sorting, using trees, heaps, sets, lists, maps and arrays. That gives you a short, honest practice set, and a clearer idea of how Amazon grades the code you write.

Coding is only one part of the loop, and our principle-by-principle Amazon question bank turns each Leadership Principle into the prompt an interviewer would use.

What Amazon says the coding rounds look like

From Amazon's prep pages for SDE II and SDE III and its SDE interview FAQ video:

  • Online assessment (SDE II). Two coding questions in 90 minutes, then a short system design section and a Work Style survey tied to the Leadership Principles. Amazon's two pages disagree slightly on timing: the interview prep page says 20 minutes of design and an 8-minute survey, the assessment page about 15 and 10. Plan for two hours, as Amazon suggests. You have seven days to complete it.
  • Online assessment (new grads). For full-time university roles: about 70 minutes of coding, a 15-minute workstyles assessment and a 60-minute work simulation. Amazon tells you to set aside up to two hours, though the listed averages add up to more, and the assessment comes in one or two parts depending on the country. Internship assessments drop the work simulation and take about 90 minutes.
  • The loop. SDE II candidates get four 55-minute interviews; SDE III candidates get five. Results come within five business days.
  • Code, not pseudocode. "Expect to be asked to write syntactically correct code—no pseudo code," the prep pages say. Interviewers also check edge cases and whether bad input gets through.
  • No IDE. The FAQ video describes a web-based shared editor with basic colour coding, not a modern IDE. Amazon recommends practising coding outside an IDE.
  • Any language. You can use any language you're comfortable with, and even switch languages between interviews.
  • Behavioural questions in every interview. Each interviewer typically asks two or three questions based on the Leadership Principles, and Amazon recommends the STAR format. There are no brain teasers.

Two details are easy to miss. Amazon's topic page says interviewers "won't be evaluating your ability to memorize" details; they want to see you apply what you know. And in the FAQ video, an engineer explains that each interviewer in the loop assesses a different competency. One focused on problem solving may ask you to adapt a brute-force answer to new requirements; one focused on algorithms and data structures is more likely to want the optimal version.

The Amazon practice question that is LeetCode 1268

In a video series on Amazon's SDE II prep page, an engineer works through a question titled "Amazon customer reviews" on HackerRank, the platform Amazon's assessment page tells you to get comfortable with. The question:

Amazon is building a way to help customers search reviews quicker by providing real-time suggestions to search terms when the customer starts typing.

The rules: suggest at most three keywords from a repository after each character typed; if more than three match, return the first three alphabetically; start suggesting only once two characters have been typed; compare case-insensitively; return the results in lowercase. The example repository is mobile, mouse, moneypot, monitor and mousepad, with the query "mouse".

LeetCode 1268 (Medium, free) uses that exact example. The differences are the ones worth practising:

  • — LeetCode 1268 — Amazon's version
  • When suggestions start — After the first character — After the second character
  • Case — Lowercase input only — Case-insensitive, lowercase output
  • Output for "mouse" — 5 lists — 4 lists

The video is valuable because the engineer gets it wrong first, in exactly the ways candidates do. The first run returns five suggestions instead of three, because the "at most three" rule was forgotten. Fixing that exposes a second miss: suggestions started at the first character, not the second. Then an off-by-one ends the loop one character early. After those fixes the two visible test cases pass, but several hidden test cases fail. Printing the inputs shows uppercase letters: the case-insensitivity rule was never implemented. Three of the four bugs were requirements stated in the question.

Here is a version that handles all the rules. Sort the repository once; after that, every word sharing a prefix sits in one contiguous block, so a binary search finds where it starts:

from bisect import bisect_left

def keyword_suggestions(repository, customer_query):
    words = sorted(w.lower() for w in repository)   # compare case-insensitively
    query = customer_query.lower()
    result = []
    for i in range(2, len(query) + 1):              # nothing until 2 characters
        prefix = query[:i]
        start = bisect_left(words, prefix)          # first word >= prefix
        matches = [w for w in words[start:start + 3] if w.startswith(prefix)]
        result.append(matches)
    return result

# keyword_suggestions(["mobile", "mouse", "moneypot", "monitor", "mousepad"], "mouse")
# -> [["mobile", "moneypot", "monitor"], ["mouse", "mousepad"], ["mouse", "mousepad"], ["mouse", "mousepad"]]

In the follow-up video, the engineer is asked the Big O of the brute-force solution and how to improve it. The engineer first mentions a tree-based approach, then says the first thing to try is filtering the repository by the query's prefix before looping, which avoids a large refactor. Binary search on the sorted list, as above, or a trie are the standard next steps. One clarifying question worth asking here: the repository strings are unique, but are they still unique after lowercasing "Mouse" and "mouse"?

A second sample: robots on a grid

A separate video on the same page uses a problem with no obvious LeetCode twin. You get a time series as a 2D array of ones and zeros: each row is a moment, each one a robot. Return whether the series is valid, given that a robot can move at most one position per step.

The engineer's point is that the obvious solution, checking the neighbours of each one in the previous row, fails three ways: it reads out of bounds at the edges, it ignores the robot count passed in as a parameter, and it misses robots that collide. The collision and robot-count misses would have been caught by asking about use cases, not only data formats: Can two robots occupy the same slot? Is every row guaranteed to have the same number of ones? The interviewer's answers were no to both.

The walkthrough then writes a working version first (count the robots in each row, map each row to robot positions, compare consecutive rows) and only then the optimal one, which keeps the same time complexity but uses constant space by tracking the last position used. Amazon's advice, stated in that video: write a solution that works, then optimise, and leave time at the end to do it.

What to practise: one or two problems per topic Amazon names

These problems aren't a leaked list. They cover the topics Amazon's engineers name in the coding video (the first eight rows), plus two extra rows for graphs and for prefix search and design, which the video does not name but which relate to the robot-grid and customer-reviews samples. All are free on LeetCode:

  • Topic — Practice problem — Difficulty
  • Maps and arrays — 1. Two Sum; 49. Group Anagrams — Easy; Medium
  • Sets — 128. Longest Consecutive Sequence — Medium
  • Lists — 143. Reorder List — Medium
  • Heaps — 347. Top K Frequent Elements; 973. K Closest Points to Origin — Medium
  • Tree traversal — 102. Binary Tree Level Order Traversal; 236. Lowest Common Ancestor of a Binary Tree — Medium
  • Greedy — 55. Jump Game — Medium
  • Dynamic programming — 322. Coin Change; 139. Word Break — Medium
  • Sorting — 56. Merge Intervals — Medium
  • Graphs and grids — 200. Number of Islands; 994. Rotting Oranges; 207. Course Schedule — Medium
  • Prefix search and design — 1268. Search Suggestions System; 208. Implement Trie; 146. LRU Cache — Medium

The engineer in the coding video recommends breadth across data structures over depth in one, so finish the table before going deep on any single topic.

How to practise so it matches the real round

Read for longer than feels necessary. The coding sample suggests at least two to three minutes on the question. Three of the four bugs in the HackerRank video were requirements stated in the prompt.

Ask about use cases, not just inputs. Array lengths and empty inputs are the easy clarifying questions. The robot problem turns on collisions and robot counts, which only come up if you ask how the system behaves.

Practise in a plain editor. The live interview editor shown in Amazon's coding sample can't compile or run your code. Write in a plain text editor with a timer: the coding sample allowed about 25 minutes for the question. In that video the engineer says perfect syntax isn't expected, while the prep pages ask for syntactically correct code. Aim for correct; readable matters too, with small functions, little repetition and comments where logic is hard to follow.

Say when you use a library function. That's usually fine, the engineer says, as long as you mention it. If the library function solves the core problem for you, the interviewer may ask you to implement it yourself.

Test by hand. You won't have time for unit tests. After coding you'll be asked to validate with an example: write a case that isn't the happy path and walk your code through it line by line.

Know your complexity and the trade-off. You'll be asked for time and space complexity and what the optimum is. The FAQ video adds that an O(n²) solution with no extra memory can sometimes beat a faster one that allocates more.

Practise the assessment as written. For new-grad assessments, Amazon allows publicly accessible resources such as documentation, but logs browser usage and says: "We expect this to be your own code."

Don't treat the behavioural side as separate. Every interview includes Leadership Principle questions. Amazon lists 16 principles; prepare stories with metrics, since Amazon calls itself a data-driven company and asks for numbers where they apply.

If you want a second opinion on your practice solutions, Verve's Coding Interview Copilot captures a question from your screen and returns a solution, with quick actions such as Optimize, Edge Case and Complexity. Solve the problem yourself first, then compare: the value is in seeing what you missed.

For the behavioural half, see our guide to Amazon STAR interview questions and the Amazon question bank. For the assessment, read what to expect in the Amazon online assessment. To compare with another big-tech loop, see Google's LeetCode interview questions.

Sources

  • SDE II interview prep (online assessment sections and timings, four 55-minute interviews, syntactically correct code, edge cases, practising outside an IDE, two or three behavioural questions per interviewer, STAR, no brain teasers, metrics, results within 5 business days; links to the video transcripts below): https://www.amazon.jobs/content/en/how-we-hire/sde-ii-interview-prep
  • SDE III interview prep (five 55-minute interviews): https://amazon.jobs/content/en/how-we-hire/sde-iii-interview-prep
  • SDE II online assessment prep (90 minutes for 2 coding questions, design about 15 minutes, work styles about 10, reserve two hours, seven days to complete, HackerRank): https://amazon.jobs/content/en/how-we-hire/sde-ii-oa-prep
  • University SDE online assessment (full-time and internship sections and timings, one or two parts by country, public documentation allowed, browser usage logged, "We expect this to be your own code"): https://amazon.jobs/content/en/how-we-hire/university/sde-oa
  • SDE interview topics ("won't be evaluating your ability to memorize", practise outside an IDE): https://amazon.jobs/content/en/how-we-hire/interview-prep/software-development-topics
  • Leadership Principles (16 principles): https://www.amazon.jobs/content/en/our-workplace/leadership-principles
  • Transcript, SDE Interview Coding Example (robot time-series problem, the shared editor cannot compile or run code, about 25 minutes, clarifying questions on use cases, working then optimal, library functions, testing by hand, complexity, topics and data structures named): https://static.jobs.production.amazon-jobs.brightspot.cloud/0b/90/6920fd514641947d291e5e205625/transcript-sde-interview-coding-example.docx
  • Transcript, How to Break Down the Coding Problem ("Amazon customer reviews" question, its rules and example): https://static.jobs.production.amazon-jobs.brightspot.cloud/71/7d/c821917c48fe87387c036151d9fb/transcript-how-to-break-down-the-coding-problem.docx
  • Transcript, Solving the Coding Problem (brute-force approach on HackerRank): https://static.jobs.production.amazon-jobs.brightspot.cloud/cb/b6/3a48882f4857b2228ff5ad32bf99/transcript-solving-the-coding-problem.docx
  • Transcript, Running the Solution and Test Cases (the four bugs, visible and hidden test cases): https://static.jobs.production.amazon-jobs.brightspot.cloud/4d/2b/8cee34ac44eab0e67f5177e6d970/transcript-running-the-solution-and-test-cases.docx
  • Transcript, Fine Tuning the Solution (Big O follow-up, prefix filtering as the first improvement): https://static.jobs.production.amazon-jobs.brightspot.cloud/06/d6/317348c142aa96f06481b2bde6c7/transcript-fine-tuning-the-solution.docx
  • Transcript, SDE Interview FAQs (any language, web-based editor without a modern IDE, different competencies per interviewer, brute force as a starting point, O(n²) with no extra memory, no time for unit tests, validate with an example): https://static.jobs.production.amazon-jobs.brightspot.cloud/7d/ef/5e9012d545ba95aa2892723617e3/transcript-sde-interview-faqs.docx
  • LeetCode 1268 statement, example and difficulty (read from LeetCode's public problem data): https://leetcode.com/problems/search-suggestions-system/
  • Difficulty and free status of the other practice problems (read from LeetCode's public problem data): https://leetcode.com/problems/two-sum/ , https://leetcode.com/problems/group-anagrams/ , https://leetcode.com/problems/longest-consecutive-sequence/ , https://leetcode.com/problems/reorder-list/ , https://leetcode.com/problems/top-k-frequent-elements/ , https://leetcode.com/problems/k-closest-points-to-origin/ , https://leetcode.com/problems/binary-tree-level-order-traversal/ , https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ , https://leetcode.com/problems/number-of-islands/ , https://leetcode.com/problems/rotting-oranges/ , https://leetcode.com/problems/course-schedule/ , https://leetcode.com/problems/jump-game/ , https://leetcode.com/problems/coin-change/ , https://leetcode.com/problems/word-break/ , https://leetcode.com/problems/merge-intervals/ , https://leetcode.com/problems/implement-trie-prefix-tree/ , https://leetcode.com/problems/lru-cache/
  • Coding Copilot (screen capture, solution, quick actions): https://docs.vervecopilot.com/features/coding-copilot
R

Ryan

CEO of Verve AI

Related reads

Explore related blog posts

Top 30 Most Common Amazon Interview Question Bank You Should Prepare For
October 19, 2026Interview prep guide

Amazon Interview Question Bank: The Questions That Matter

How Amazon's interview loop works, the behavioral and technical questions it is built on, one worked answer, and a two-week prep plan.

Read guide
Top 30 Most Common Amazon Area Manager Interview Questions You Should Prepare For
October 19, 2026Interview prep guide

Amazon Area Manager Interview Questions and Answers

The Amazon Area Manager questions that matter, what each one tests, sample answers, how the loop works, and a one-week prep plan.

Read guide
What No One Tells You About Amazon Noida And Interview Performance
May 20, 2026Interview prep guide

Amazon Noida Interview Performance by Round: The Rubric Candidates Miss

A round-by-round breakdown of Amazon Noida interview performance — what gets judged in the OA, coding, behavioral, system design, and final hiring decision.

Read guide
What Should You Know About Amazon Internal Relocation Package L5 Reddit
March 11, 2026Interview blog

Amazon Relocation Package L5: What to Ask and What's Taxed

Amazon doesn't publish its L5 relocation policy. What is known, how relocation pay is taxed in the US, and what to settle before you accept.

Read story
Top 30 Most Common Amazon Phone Interview Questions You Should Prepare For
October 23, 2026Interview prep guide

Amazon Phone Interview: Format, Questions and Prep

What Amazon's own prep pages say about the phone screen for each role, the questions it publishes, one worked answer and a one-week plan.

Read guide
Amazon Online Assessment: What's on It and How to Prepare
February 16, 2026Interview blog

Amazon Online Assessment: What's on It and How to Prepare

Amazon online assessment explained: coding, work simulation and work style sections, timing, Amazon's own rules and how to prepare.

Read story
How Can Software Engineer At Amazon Salary Data Change Your Negotiation Strategy
February 13, 2026Interview blog

How Can Software Engineer At Amazon Salary Data Change Your Negotiation Strategy

Use Amazon software engineer salary data to refine your negotiation strategy, maximize compensation, and close offers.

Read story
Amazon’s Massive Tech Layoffs Signal a Harder Year Ahead for Job Seekers — Here’s How to Adapt
March 14, 2026Interview blog

Amazon’s Massive Tech Layoffs Signal a Harder Year Ahead for Job Seekers — Here’s How to Adapt

Amazon's tech layoffs foreshadow a tougher hiring market. Learn practical strategies to pivot, upskill, and land jobs faster.

Read story
Amazon and UPS Layoffs Signal a Tougher Job Market — Here’s How to Adapt Now
March 20, 2026Interview blog

Amazon and UPS Layoffs Signal a Tougher Job Market — Here’s How to Adapt Now

Facing Amazon and UPS layoffs? Learn practical steps to protect your career, update skills, and find new opportunities now.

Read story

Walk into every interview prepared and confident

Get Started For Free

Available on Mac, Windows, browser and mobile