Amazon Interview Questions: 75 You Can Expect To See In Your Interview

May 17, 2021

Amazon is one of the most popular and sought-after big tech companies to work in if you’re a software engineer. In this post, we’ll mention 75 of the most common questions in technical interviews from Amazon, as well as how you can use Tech Interview Pro, a proven program offering hundreds of coding walk-throughs that also prepares you for the soft side of the interview, to ace these questions.

It’s known by everyone that getting a job at one of the big tech companies can be quite challenging.

And in a way, the interviews at companies like Google, Facebook, and Amazon are almost as famous as the companies themselves.

Here are 75 of the most common questions you can expect to see in your Amazon interview: both from a technical and a behavioral perspective.

Amazon Technical Questions

  1. Write a function that finds the frequency of each element in a given array.
  2. Given an n-ary tree and some queries for the tree, write a function that prints the preorder traversal of the subtree rooted to a given node.
  3. Given an array of numbers, write a function that prints the range in which each number is the maximum element.
  4. Write a function that displays the nodes of a tree in level order.
  5. Given the entire dictionary of English words, what data structure would you use to efficiently store and match a custom regex string like “D*sk”, where * represents any single character, and return a list of matched words?
  6. Write a function that counts the occurrence of a number in a given string.
  7. Given a string of numbers, write a function that places commas in the number so that it becomes easier to read. (Example: 1000000 = 1,000,000)
  8. Design a system that will keep track of a product and its inventory count.
  9. Write a function that returns a given integer in string form.
  10. Given a binary array, write a function that sorts the array in a way that all zeros come to the left and all ones come to the right.
  11. Design a service that scans photos/videos for any malware.
  12. Write a method that merges a fixed number of streams containing an infinite sequence of monotonically increasing integers into an output stream of monotonically increasing integers.
  13. Write a method that returns the value “True” if the number ‘1’ appears consecutively throughout the given array.
  14. Given a list of nodes, with each node having an ID and a parent ID, determine whether the list is given in preorder.
  15. Given a set of inter-dependent tasks along with the time taken to execute them, write a function that calculates the minimum time required to complete every task.
  16. Design an authentication system using AWS services like an API gateway and Lambda.
  17. Design an online chess game.
  18. Design a movie reviews aggregator system.
  19. Find the sum of n elements after a kth smallest element in a BST.
  20. Design a subscription-based sports website that can display scores, game statuses, and the history of any game.
  21. Given an infinite stream of numbers, write a function that prints the smallest K elements at any point.
  22. Write a function that finds the minimum length of an unsorted subarray.
  23. Given an MxN binary matrix, write a method that finds the largest sub-square matrix that only contains 1s.
  24. Write a function that finds the maximum difference between a node and its ancestor in a binary tree in O(n) time.
  25. Given an array of integers, write a function that point updates and range sums in minimum time.
  26. Given a list of numbers of odd length, design an algorithm to decide whether it’s possible to remove any number from the list and split the remaining numbers into two sets of equal length with the same sum.
  27. Given an arithmetic expression, write a method that finds the value of the expression (The only binary operations that are allowed are +, -, *, and /).
  28. Write an algorithm that finds an unsold item in Amazon’s products.
  29. Given two sorted lists and a number K, create an algorithm that fetches the least K numbers of the two lists.
  30. Given a dictionary of fixed words, write an algorithm that finds the maximum chain of words that can be formed by any of these words (A chain is formed by picking a word and removing one character from it: this newly formed word should be present in the dictionary).
  31. Write a function that reconstructs a sentence by adding missing whitespaces.
  32. Given an array, write a function that finds all valid IP addresses contained within it.
  33. Given a list of shops (each of which has a list of toys, their prices, and max number of children who can play with it at a time), write a function that outputs a list of best possible toy options from each shop given the number of children who are shopping.
  34. Given an array of 1 billion numbers with just a few 100 numbers missing, write a function that finds all the missing numbers.
  35. Design the classes for a Battleship game and write the attack function.
  36. Write a program that checks whether the data structure given is a valid binary tree or not.
  37. Design a login system that contains multiple application servers which are login the information to a file system.
  38. Given two sorted lists and an integer K, write a function that merges the lists up to a maximum of K elements.
  39. Given a binary tree and a value X, write a method that finds X in the tree and returns its parent.
  40. Write a function that prints the longest path from root to leaf in a binary tree.
  41. Write an algorithm for reversing letters of a string in Java.
  42. Design an ATM machine system.
  43. Write a function that finds the sum of N elements after the Kth smallest element in a BST.
  44. Design and implement a traffic control system with pedestrian signal management included.
  45. Given a binary tree, write a function that prints the nodes in a vertical zig-zag line pattern.
  46. How would you design a hash table?
  47. Design a system that will let multiple sellers upload their products to Amazon’s seller programs.
  48. Write a function that determines if the given doubly linked list is a palindrome or not.
  49. Given a sorted array that has been rotated N number of times, write a function that finds the value of N.
  50. Given a binary tree and a target number, return whether or not there exists a path that can create the target number.

Amazon Technical Answer Examples

All answers written in C++.

Coding Example #1: Given an infinite stream of numbers, write a function that prints the smallest K elements at any point

#include <climits>
#include <iostream>
using namespace std;
// Prototype of a utility function 
// to swap two integers
void swap(int* x, int* y);
// A class for Min Heap
class MinHeap {
    int* harr; // pointer to array of elements in heap
    int capacity; // maximum possible size of min heap
    int heap_size; // Current number of elements in min heap
    MinHeap(int a[], int size); // Constructor
    void buildHeap();
    void MinHeapify(
        int i); // To minheapify subtree rooted with index i
    int parent(int i) { return (i - 1) / 2; }
    int left(int i) { return (2 * i + 1); }
    int right(int i) { return (2 * i + 2); }
    int extractMin(); // extracts root (minimum) element
    int getMin() { return harr[0]; }
    // to replace root with new node x and heapify() new
    // root
    void replaceMin(int x)
        harr[0] = x;
MinHeap::MinHeap(int a[], int size)
    heap_size = size;
    harr = a; // store address of array
void MinHeap::buildHeap()
    int i = (heap_size - 1) / 2;
    while (i >= 0) {
// Method to remove minimum element 
// (or root) from min heap
int MinHeap::extractMin()
    if (heap_size == 0)
        return INT_MAX;
    // Store the minimum vakue.
    int root = harr[0];
    // If there are more than 1 items, 
    // move the last item to
    // root and call heapify.
    if (heap_size > 1) {
        harr[0] = harr[heap_size - 1];
    return root;
// A recursive method to heapify a subtree with root at
// given index This method assumes that the subtrees are
// already heapified
void MinHeap::MinHeapify(int i)
    int l = left(i);
    int r = right(i);
    int smallest = i;
    if (l < heap_size && harr[l] < harr[i])
        smallest = l;
    if (r < heap_size && harr[r] < harr[smallest])
        smallest = r;
    if (smallest != i) {
        swap(&harr[i], &harr[smallest]);
// A utility function to swap two elements
void swap(int* x, int* y)
    int temp = *x;
    *x = *y;
    *y = temp;
// Function to return k'th largest element from input stream
void kthLargest(int k)
    // count is total no. of elements in stream seen so far
    int count = 0, x; // x is for new element
    // Create a min heap of size k
    int* arr = new int[k];
    MinHeap mh(arr, k);
    while (1) {
        // Take next element from stream
        cout << "Enter next element of stream ";
        cin >> x;
        // Nothing much to do for first k-1 elements
        if (count < k - 1) {
            arr[count] = x;
        else {
            // If this is k'th element, then store it
            // and build the heap created above
            if (count == k - 1) {
                arr[count] = x;
            else {
                // If next element is greater than
                // k'th largest, then replace the root
                if (x > mh.getMin())
                    mh.replaceMin(x); // replaceMin calls
                                      // heapify()
            // Root of heap is k'th largest element
            cout << "K'th largest element is "
                 << mh.getMin() << endl;
// Driver program to test above methods
int main()
    int k = 3;
    cout << "K is " << k << endl;
    return 0;

Coding Example #2: Write a function that finds the minimum length of an unsorted subarray

using namespace std; 
void printUnsorted(int arr[], int n) 
int s = 0, e = n-1, i, max, min;  
// step 1(a) of above algo 
for (s = 0; s < n-1; s++) 
    if (arr[s] > arr[s+1]) 
if (s == n-1) 
    cout << "The complete array is sorted"; 
// step 1(b) of above algo 
for(e = n - 1; e > 0; e--) 
    if(arr[e] < arr[e-1]) 
// step 2(a) of above algo 
max = arr[s]; min = arr[s]; 
for(i = s + 1; i <= e; i++) 
    if(arr[i] > max) 
    max = arr[i]; 
    if(arr[i] < min) 
    min = arr[i]; 
// step 2(b) of above algo 
for( i = 0; i < s; i++) 
    if(arr[i] > min) 
    s = i; 
// step 2(c) of above algo 
for( i = n -1; i >= e+1; i--) 
    if(arr[i] < max) 
    e = i; 
// step 3 of above algo 
cout << "The unsorted subarray which" 
     << " makes the given array" << endl 
     << "sorted lies between the indees " 
     << s << " and " << e; 
int main() 
    int arr[] = {10, 12, 20, 30, 25, 
                 40, 32, 31, 35, 50, 60}; 
    int arr_size = sizeof(arr)/sizeof(arr[0]); 
    printUnsorted(arr, arr_size); 
    return 0; 

Travel With Peace Of Mind

Staying safe and healthy while you travel has never been more important than it is today. Join the world’s most user-friendly insurance company, SafetyWing, for less than $1.50/day. Cancel penalty-free any time.

Amazon Behavioral Questions

  1. Can you describe a time when you took the lead on a project?
  2. You witness a co-worker stealing. The value of the item is $2. What is your response?
  3. Describe a time when you had a set amount of time to complete a task.
  4. When you have the interests of large numbers of customers to think about, how do you prioritize their needs?
  5. Thinking about your current role, tell me about something that you have learned recently.
  6. Imagine a situation where separate managers have given you the same work to do, but that the priorities on each are different. What do you do?
  7. Tell me about a time you failed to meet a deadline. How did you cope with that?
  8. Have you ever faced a complex problem and managed to come up with a simple solution? Tell me about that.
  9. What is your proudest professional achievement?
  10. Why do you want to work for Amazon?
  11. Have you ever had to make a quick customer service decision without any help or guidance from a co-worker or manager? How did you arrive at a decision?
  12. Tell me about a time you have disagreed with your manager and how you handled it.
  13. How do you motivate others? Can you give me an example of a time you have motivated someone?
  14. You are asked by a supervisor to do something that is against policy and is unsafe. How would you handle that?
  15. Tell me about a time when you have had to work to earn someone’s trust.
  16. How do you deal with having to provide feedback to someone?
  17. Tell me about a time when you had to deal with ambiguity. How did you overcome the ambiguity to reach a positive outcome?
  18. Think about a time you received negative feedback. How did you deal with that?
  19. Can you describe a time when you took the lead on a project?
  20. Can you give me an example of a time when you exceeded expectations?
  21. Tell me about a time when you were working on a project, and you realized that you needed to make changes to what you were doing. How did you feel about the work you had already completed?
  22. Tell me about your most challenging customer. How did you resolve their issues and make them satisfied?
  23. Describe a time when you had to make a decision without having all the data or information you needed.
  24. Which Amazon leadership principle resonates with you most?
  25. How do you motivate co-workers to work together as a team?

Amazon Behavioral Answer Examples

Behavioral Example #1: Tell me about a time you have disagreed with your manager and how you handled it

To answer this question, talk about what led to the conflict between you and your boss and any necessary background information.

The biggest thing is to discuss why the disagreement came up: whether it’s related to lack of communication or a difference of opinion, provide the full details. When you paint the scene well, the interviewer can picture what happened and it sets you up for the rest of your answer.

Behavioral Example #2: Can you describe a time when you took the lead on a project?

To answer this question, choose an example where you delivered on time and within budget results. Talk about how you utilized both the people and non-people resources available to you to deliver the expected results.

If you haven’t actually managed people or projects, substitute the word “led” for managed. In most cases, even individual contributors have led people and/or projects.

Behavioral Example #3: Which Amazon leadership principle resonates with you most?

To answer this question, you should pick something relevant for your job, and something that matches your personality.

For example, if you apply for a creative position with Amazon (something in software development, marketing, process engineering, etc), you can choose principle no. 3: Invent and simplify.

Why Tech Interview Pro?

So, some of these questions can be pretty easy to tackle.

But as I’ve mentioned in our Microsoft article, you can’t rely on getting only questions rated Easy to get through your interviews.

You’re just as likely to get every question to be rated Hard, and if you really want to have the best possible chance of success, it’d be better to study like if that were the case.

But how do you go about efficiently studying if you’re going to study that hard?

I recommend you use Tech Interview Pro, an interview prep program designed by a former Google and Facebook software engineer who has compressed the knowledge he gathered from conducting over 100 interviews during his time into a single course.

And here are a few reasons why I recommend it.

#1 A Comprehensive Approach

Tech Interview Pro takes a thorough approach to its teaching, taking both the technical and behavioral aspects into consideration in its 20+ hours of video lessons.

Here’s TIP’s course outline:

  1. Understanding The Interview Process
  2. Four Axes of the Interview
    1. Coding
    2. Data Structures & Algorithms
    3. Systems Design
    4. Communication
  3. Interviewing Masterclass
  4. Data Structures & Algorithms
  5. 100+ Coding Sessions
  6. The Mock Interview
  7. Systems Design
  8. Transitioning Careers
  9. Negotiating & Accepting Your Offer

As you can see, TIP has a balance of both the technical and the behavioral, which is definitely more coverage than most of the tech interview prep courses out there.

#2 Private Facebook Group

Another neat feature that Tech Interview Pro grants its students is access to a private Facebook group with 1,500+ former students of the course.

Here are some of their success stories:

Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories

When you consider how many TIP students have landed jobs at FAANG companies thanks to the course, as well as how active and supportive the Facebook group is day to day, it’s really an invaluable resource to have.

#3 Created By An Industry Insider

Tech Interview Pro is run by an industry veteran who has reverse-engineered the hiring process to give you the best chance of success.

TechLead (Patrick Shyu) has grown his own websites to millions of users, spent his recent years working at Facebook and Google, and has conducted over 100 technical interviews for Google.

So if there’s anyone who can teach you how to ace your technical interviews, it’s this guy.

#4 Bi-Weekly Q&A Sessions

Every two weeks, TIP students can engage in Q&A sessions with the course’s founder, TechLead.

This is a huge advantage: after all, nothing’s stopping you from asking any of the questions featured on the list above, whether it’s a technical question or a behavioral one, and you can expect a thorough answer in return.

Another thing to keep in mind is that every Q&A session is recorded and ready to be accessed at any time, so there’s nothing stopping you from checking previous Q&A sessions too.

#5 Resume Reviews

Your resume will be the first thing a recruiter will see coming from your end, and making it look pretty won’t be enough: you need to make sure it knocks them out when they see it so that you can have a headstart into the interviewing process.

Considering this, TechLead will also personally review your resume and help you tailor it for the position and the company you seek to apply for.

#6 Lifetime Access

Lastly, TIP grants lifetime access to the entire course and private Facebook group, which means that you’ll be able to see new video lessons as they’re added, grow alongside the Facebook group, watch all of future Q&A sessions, and everything else.

TIP’s got your back, whether you want to land a job now or in the future.

In Summary

Getting into Amazon as a software engineer is no walk in the park, and most of their technical and behavioral questions can be pretty tricky to handle.

However, as long as you adequately prepare for these questions in advance, you should have a pretty good chance of leaving the interviewing room unscathed. To give yourself the best possible chance of success, we recommend you prepare with a more comprehensive, battle-tested solution like Tech Interview Pro.

The Best Crypto Exchanges In Canada

Best Overall

Supports: 16 cryptocurrencies
Security: 95% cold storage
Trading fees: 0.2%

$50 bonus ends May 19.


Rated 4.9/5

Lowest Fees

Supports: 17 cryptocurrencies
Security: 95% cold storage
Trading fees: 0.1% - 0.2%

Free account, instant verification


Rated 4.8/5

Best For Altcoins

Spreads: ~0.5%
Security: 95% cold storage
Signup bonus: $30

Low spreads, great platform.


Rated 4.5/5