Amazon Interview Questions

With its mission of being “Earth’s most customer-centric company,” Amazon is one of the top places to work for in 2020. So before we get into the interview questions, let’s first understand the company culture and the Interview Process.

They say it is always Day 1 at Amazon, and the focus is on hiring employees that make fast decisions, stay smart, innovate for customers, and remain nimble. To understand the kind of company Amazon is, you need to look at some highlights from annual letters that Bezos writes to the shareholders.

  • “Our success will be largely affected by our ability to attract and retain a motivated employee base, each of whom must think like, and therefore must actually be, an owner.”
  • “We want to be a large company that’s also an invention-machine. We want to combine the extraordinary customer-serving capabilities that are enabled by size with the mentality normally associated with entrepreneurial start-ups.”
  • “We don’t do PowerPoint presentations. Instead, we write narratively structured memos and silently read one at the beginning of each meeting in a kind of “study hall.” These papers generally range from one to six pages and articulate the project goal(s), approach to addressing it, outcome, and next steps.”
  • “We believe in building  a culture of high standards.”

To maintain this culture of customer obsession and ownership, Amazon employs an extensive interview process with multiple rounds that test your aptitude, coding ability, and technical prowess. These rounds are then followed by interviews with the hiring manager as well as the HR team. This all boils down to Jeff Bezos’ ideology of

“I’d rather interview 50 people and not hire anyone than hire the wrong person.”

But well, preparation is the key to success. Let’s go over everything one step at a time and create a checklist that you can be prepared to conquer the mountain that is the Amazon Interview.

Amazon Interview Questions - Key Technical Areas

Before we get into the actual questions, let’s look at the major topics that candidates are generally tested on during Amazon interviews.

Data Structures

Most of Amazon’s work involves storing data and providing access to it in the most efficient ways. Thus, it is an essential requirement that you be well-versed with how data structures work and are able to compare them based on their usage applications.

Databases

As you will be working with a lot of data at Amazon, you need to fetch it from the store and push data in there for future use. You need to be comfortable with basic Database concepts and their applications in various scenarios.

Algorithms

Having a thorough understanding of commonly used algorithms is essential to be a great software engineer, and that’s what Amazon looks for. We will go over the specific algorithms later. Still, you need to know the runtimes, limitations, and implementation strategies for each algorithm before you head into the interview.

Object-Oriented Design

Object-oriented programming is one of the best system design practices to create bug-free code that can be extended when needed - making it a highly efficient system. You must have a working knowledge of writing code in an object-oriented manner and some common design patterns.

Internet-related topics

Being an e-commerce company, Amazon needs software engineers that have a sound understanding of how the world wide web works. Being familiar with the fundamentals of browser functions, DNS, and TCP/IP is yet another essential skill to have.

Machine Learning & Artificial Intelligence

Amazon is one of the front-runners in the technology space, and being familiar with basic concepts and algorithms can provide the extra edge that sets you apart. Understand how train/test protocols work in data-driven modeling and have an idea of how you can provide an exhaustive plan on dealing with any machine learning problem given to you.

Now that we’ve understood the key areas that Amazon tests candidates on, let’s go over some specific topic-wise questions.

Interview Questions - Data Structures

Arrays

  1. An unsorted array of non-negative integers is provided, and you need to find a continuous sub-array, the numbers of which add up to a given value.
  2. An unsorted array is provided, and you need to count the total number of triplets that are formed in such a way that the sum of the first two values adds up to the third number.
  3. Kadane’s Algorithm: An array is provided, and you need to find the continuous subarray with the maximum sum.
  4. An unsorted array and a list of values (that are supposed to be in the array) are provided. You need to find the number missing in the array.
  5. You are given two arrays, and you need to merge the two arrays to output one sorted array.
  6. A sorted array is provided, and you need to arrange the values in a way that the maximum and the minimum values appear in an alternate fashion.
  7. Given two arrays A & B, you need to find the number of pairs where ab>ba, where a & b are elements from A & B, respectively.
  8. You are provided an unsorted array, and you need to determine its inversion count - an indication of how far the array is from being sorted.
  9. You are given an array of 0s, 1s, and 2s. You need to arrange it in an ascending or descending order.
  10. An array is provided, and you need to find the equilibrium point - the point where the sum of the elements before it equals the sum of elements after it.
  11. In the given array, you are required to find the leader—the value which is greater than all the values that come after it.
  12. You are provided with the arrival and departure times of trains and are required to find the minimum number of platforms needed such that no train waits.
  13. A sorted array is provided, and you need to reverse every sub-array of a fixed number of elements.
  14. You are provided an array and a number ‘X’ that is smaller than the size of the array. Your task is to find the Xth smallest number in the array.
  15. Rain Water Trap: You are provided an array of non-negative integers where each element represents the height of the blocks at that point, while the width of each of these blocks is 1 unit. With water being trapped in each of the empty areas, find the total amount of water that can be trapped after raining.
  16. Pythagorean Triplet: An array of integers is provided, and you need to write a program that returns ‘True’ if there is a sub-array of values such that a2 + b2 = c2.
  17. Chocolate Distribution: Provided an array of positive integers where each value represents the number of chocolates in a packet, your task is to distribute these packets to a given number of people in a way that: a) Each person gets a single packet. b)The difference between the number of chocolates in the largest packet received and the number of chocolates in the smallest packet received is the minimum.Input an array from the user that has the cost of a single stock on each day and then find the days on which the stock needs to be bought and then sold such that the profit is maximum.
  18. You are provided an unsorted array, and you need to find the first element which has all smaller elements to its left and larger elements to its right
  19. An unsorted array is provided, and you need to arrange all the elements in a zig-zag fashion such that a<b>c<d>e<f and so on.
  20. An array is provided that has only 0s & 1s. You need to find the position of the last 1 that occurs in the array.
  21. Provided an array of any given size, you need to traverse and print the array in a spiral form.
  22. Given a set of numbers, you need to place them next to each other and create the largest number possible. Print the number out as a string.

Strings

  1. You are provided a sentence, and you need to reverse the sentence without reversing any word.
  2. Print out all the possible permutations of a string provided.
  3. Find the longest palindrome that is a subset of a given string.
  4. Remove all adjacent duplicates from an input string.
  5. Input two strings and check if one string can be obtained by reversing the other
  6. Input a Roman number as a string and convert it to an integer value.
  7. Input two strings and check if the strings are anagrams of each other.
  8. Remove all duplicates from an input string.
  9. Input a string and find the least number of characters needed to make it a palindrome.
  10. Input a string and then identify the length of the largest substring that has all distinct values.
  11. Input a string and then convert it to an integer value.
  12. Input two strings and then locate the occurrence of one string in the other.
  13. Input an array of string and then find the largest prefix common to all strings.
  14. In an array with multiple words, you need to find the word that gets repeated the most.
  15. You are provided with two strings. You need to remove all the common elements and concatenate them both.

Trees

  1. Find the height of a given binary tree.
  2. Convert a given binary tree to its mirror.
  3. Print the in-order traversal of a given binary tree.
  4. Print the pre-order traversal of a given binary tree.
  5. Remove all the half-nodes from a given binary tree.
  6. Convert a given binary tree to a Circular Doubly Linked List in-place. Use the left and the right pointers in nodes as previous and next pointers, respectively.
  7. Clone a given binary tree that has random pointers.
  8. Two arrays are provided to you - one that has the pre-order traversal and another that indicates whether each node is a leaf node or not. Using these arrays, create a binary tree.
  9. You are provided with a binary tree that consists of arithmetic operators and integers. You are supposed to evaluate and print the tree’s final output as an integer.
  10. Given a number ‘X’ and a binary tree, you are supposed to print all the elements that appear at the Xth position from the root.
  11. Print out the sum of all nodes at each level in a binary tree
  12. Print out the difference between the sum of all nodes at even levels and the sum of all nodes at odd levels.
  13. Provided a binary tree, input a target node, and an integer ‘X’ to then print all the nodes that are at X distance from the target node
  14. Input two nodes and a binary tree. Your task is to find the distance between the two nodes - the number of turns needed to go from one point to the other.

Linked Lists

  1. Input two linked lists and a number ‘X’. Find the total number of pairs that have a total sum of ‘X.’
  2. Input a reference point and the order of arrangement. Then sort the list in the specified order using MergeSort.
  3. Input a singly linked list and then print it out after deleting the middle value.
  4. Input two linked lists and then print their union after removing all duplicates.
  5. You are provided a linked list, and your task is to group odd and even elements in separate groups and place the group of odd elements before the group of even elements.
  6. Given a singly linked list, input order and rearrange the list in the specified order.
  7. Given a linked list, input a reference point index and delete the value at that point.
  8. Input two polynomials in the form of linked lists and then add the respective coefficients to obtain the sum of two polynomials. Print the final polynomial.
  9. Provided a singly linked list, input a number ‘X’ and then swap the Xth node from each end of the linked list.
  10. From a given linked list, extract and reverse the alternate nodes. Append this new list to the original list and print the final list as output.

Dynamic Programming

  1. A player in a game can score either 3, 5, or 10 in each move. Provided a score, print out all the combinations that would reach it.
  2. Input a number ‘x’ and then find the total number of strings that can be made with ‘a’,’b’, and ‘c’ where ‘b’ can be used at most once, while ‘c’ can be used at most twice.
  3. Input a string and then convert it to a palindrome by removing the least number of characters.
  4. You are provided an array of integers. Input a number ‘X’ and find all the subarrays that add up to ‘X.’
  5. Input a number ‘X’ and then find the total number of structurally unique binary search trees that can be formed with the numbers from 1 to X.
  6. Given a dictionary of words, input a string and identify if the string can be separated and explained by the dictionary. Print the string out in a way that is explained by the words in the dictionary
  7. Input an array and divide it into two sub-arrays such that the absolute difference of the subs of these sub-arrays is minimized.
  8. You are provided with a binary matrix, and you need to find the largest square sub-matrix that has only 1s.
  9. Input an array and an integer ‘X’ and then check if the array can be divided into X subsets. Print all the subsets.

Databases

  1. Illustrate the differences between primary keys and unique constraints.
  2. Explain database normalization.
  3. What is the Amazon Relational Database? Explain some of its features
  4. Explain the key-value store.
  5. Explain DynamoDB. What are some of its features & benefits?
  6. Illustrate, with an example, how DynamoDB Mapper Class works.
  7. What is auto-scaling in DynamoDB?

Redshift

Redshift is Amazon’s data warehouse product that is a part of AWS. It is a cloud-based data storage that can be used to store and analyze a massive amount of data while also allowing large-scale database migrations. By employing MPP (Massively Parallel Processing) Architecture, users can load data at breakneck speeds and run complex queries in much lesser time.

  1. What is a data warehouse, and why is it important?
  2. What is Amazon’s Redshift? What makes it popular?
  3. What is the role of Redshift in data storage?
  4. Throw some light on the difference between Redshift and Redshift Spectrum.
  5. What is the difference between a Compute node and a Leader node?

Relational Database Service (RDS) & ElastiCache

A relational database management service from Amazon, RDS makes setting up, operating, and scaling relational databases in the cloud much easier. It provides a cost-efficient resizable capacity while automating admin tasks such as setup, patching, and backups.

  1. What is Amazon’s RDS, and what are its main features?
  2. Which RDS supports database engines?
  3. What is the primary purpose of launching a standby RDS instance?
  4. Is it possible for a user to upgrade or downgrade according to their needs?
  5. What are the uses and benefits of ElastiCache?
  6. Explain the ElastiCache cluster and the different types of engines it employs

Amazon’s Leadership Principles

To understand Amazon’s company culture, a candidate must understand the 14 leadership principles that form the company’s core. Let’s dive right into these.

  1. Customer Obsession

Leaders must earn and keep customer trust by starting with them and then working backward. Do pay attention to competitors, but obsess over customers.

  1. Ownership

Leaders must think long-term and not sacrifice long-term value for results in the short-term. They must act beyond their teams and never say, “That’s not my job.” They must be owners and act on behalf of the entire company.

  1. Invent & Simplify

Leaders must always expect innovation from their team and find ways to simplify tasks and processes. They must be externally aware and look for new ideas everywhere. They should accept that as they do new things, they will be misunderstood for a long time, but should never be limited to “not invented here.”

  1. Are Right, A Lot

Leaders are generally right due to their strong judgment and good instincts. They always seek different perspectives and work to have their beliefs disconfirmed.

  1. Learn and Be Curious

Leaders must always seek to improve themselves and must never stop learning. They should always be curious about exploring new possibilities.

  1. Hire & Develop the Best

Leaders must recognize exceptional talent and must raise the bar with every hire and promotion. They should willingly move new talent throughout the organization to coach them and develop new leaders.

  1. Insist on the Highest Standards

Leaders must have exceptionally high standards. Some people might even think they are unreasonably high, but leaders should continue to raise the bar and drive teams to deliver excellent quality products and services through efficient processes. They must ensure that defects do not get passed down the line, and a fixed issue stays fixed.

  1. Think Big

Thinking small is a self-fulfilling prophecy, and hence leaders must create and communicate a bold direction that inspires results. They must always think differently and look around corners for ways to serve customers.

  1. Bias for Action

As speed is of great importance in businesses, leaders must take calculated risks to prioritize decisions and actions as some are reversible and do not require extensive study.

  1. Frugality

Leaders must be frugal and must accomplish more with less. They must understand that constraints breed resourcefulness, self-sufficiency, and invention, and hence there are no extra points for growing headcount, budget size, or fixed expense.

  1. Earn Trust

Leaders must listen attentively, speak candidly, and treat others respectfully. Even if it is awkward or embarrassing, they must always be vocally self-critical. They should never believe their team’s body odor smells of perfume and must continually benchmark their performance against the best.

  1. Dive Deep

Leaders must operate at all levels, and there must be no task that is beneath them. They must frequently audit to always be connected to the details and be skeptical when metrics and anecdotes differ.

  1. Have a backbone; Disagree & Commit

When in disagreement, leaders must respectfully challenge decisions even when it is uncomfortable or exhausting. They must have convictions and must be tenacious. They must never compromise for the sake of social cohesion, and when a decision is determined, they should commit wholly to it.

  1. Deliver Results

Leaders must focus on the key inputs for their business and deliver those with great quality and at the right time. Even with setbacks, they must always rise to the occasion and never settle.

Amazon’s Assessments

As Amazon puts a significant emphasis on the kind of people they hire, behavioral tests form an integral part of their interview process. Amazon not only tests if the candidates are a good fit in the company culture but also assesses them on their work style through what they call - Work Style Assessments and the Work Sample Simulation. Let’s understand these in a bit more detail.

Work Style Assessment

Approximately 10-20 minutes long, these are centered around Amazon’s culture and Leadership Principles. Here, the company wants to understand your work style, and you help them do that by selecting statements that best represent your choices and interests and your approach to everyday tasks.

Work Sample Simulation

These simulations can take anywhere between 20 minutes to an hour to complete and require you to demonstrate your problem-solving, prioritization, and interpersonal skills. Depending on the role that you’ve applied for, the tasks might involve interpreting data from charts, answering customer questions, resolving issues, finding the right information from multiple sources, or even multitasking.

Behavioral Interview Questions

Here are some popular behavioral questions that have been asked in some Amazon Interviews.

  1. Tell me about an instance when the path forward was not clear cut. What decisions did you take to move ahead?
  2. Tell me about a time that you tried to accomplish something but failed. What were your learnings from the entire situation?
  3. What were some occasions when you showed initiative?
  4. Tell me about a time that you motivated others—either your team or your colleagues/peers.
  5. Give me some details about a time when you had to delegate projects effectively. What were the strategies used, and how did you manage conflicts?
  6. Have their been instances when you coached someone?
  7. Tell me of a time when you adopted fact-finding and research skills to solve a problem.
  8. What excites you about Amazon, and why do you want to work here?
  9. What do you expect to learn by working at Amazon?

Questions based on Leadership Principles

  1. Which Leadership Principle do you resonate most with?
  2. If you were to add another principle in Amazon’s culture, what would you propose?
  3. Tell me of an occasion when you displayed customer obsession and went above and beyond what was expected.
  4. Tell me about a time when you worked to solve the problems for a customer who was very difficult to deal with.
  5. What does the principle “Are Right, A Lot” mean to you?

One of the top companies to work at, Amazon, has a dynamic work culture where hierarchies tend to fade, and each employee is a business owner. Some cultural practices at Amazon seem particularly peculiar, such as the culture of writing—they don’t do PowerPoint presentations. Instead, they write large memos that contain the project goals, approaches to address it, expected outcome, and the next steps. So being able to articulate your thoughts, structure them, and present them on paper is a skill that’s essential to be able to work at Amazon.


About usWhy usInstructorsReviewsCostFAQContactBlogGet Started