Skip to main content

One post tagged with "amazon"

View All Tags

· 17 min read
Shelcia

These are the content I have collected from various sources while I was preparing for my interview. Hope this one helps you as well

Amazon Interview Questions

info

Source : Geekforgeeks

Most Asked Questions

  1. K largest elements from a big file or array.

  2. Find a triplet a, b, c such that a2 = b2 + c2. Variations of this problem like find a triplet with sum equal to 0. Find a pair with given sum. All such questions are efficiently solved using hashing. – Practice here

  3. Binary tree traversal questions like left view, right view, top view, bottom view, maximum of a level, minimum of a level, children sum property, diameter etc.

  4. Convert a Binary tree to DLL – Practice here

  5. Lowest Common ancestor in a Binary Search Tree and Binary Tree.

  6. Implement a stack with push(), pop() and min() in O(1) time.

  7. Reverse a linked list in groups of size k – Practice here

  8. Given two numbers represented by two linked lists, write a function that returns sum list – Practice here

  9. Rotate a matrix by 90 degree.

  10. Stock span problem

  11. Next greater element

  12. Some Dynamic Programming problems like:

    • Maximum sum subarray such that no elements are consecutive – Practice here
    • Edit distance
    • Assembly line scheduling
  13. Why Amazon?

  14. Questions about projects done in previous company or final year.

  15. Kadane’s Algorithm

  16. Angle b/w hour and minute hand

  17. Inversion of array

  18. Paranthesis Checker

  19. 0-1 Knapsack

  20. k Largest elements

  21. Longest Palindromic

  22. Array to BST

Amazon’s Most Frequently Asked Questions 

Level – Easy

  1. Get minimum element from stack – Practice here
  2. Serialize and deserialize a binary tree – Practice here
  3. Print a binary tree in a vertical order – Practice here
  4. Celebrity problem – Practice here
  5. Level order traversal
  6. Swap the kth element from starting and from the end position – Practice here
  7. Binary tree to bst – Practice here
  8. Max sum in the configuration – Practice here
  9. Find the nth element of spiral matrix – Practice here
  10. Count the number of occurrences in a sorted array
  11. Find the smallest window in a string containing all characters of another string
  12. Find the maximum of all subarrays of size k
  13. Find the kth smallest element in row wise and column wise sorted matrix
  14. Minimum swaps required to arrange pairs
  15. There is an array of N numbers ranging from 1 to N. Only 1 number is missing, return the index of that number
  16. Find the second largest and second smallest in a given array in single traversal.
  17. Find power(x,y) without using pow function.(divide and conquer approach required)
  18. Count possible decoding sequence

Level – Medium

  1. Given two string print them inter leaving strings characters
  2. Minimum cost required to travel from top left to the bottom right in a matrix
  3. Maximum difference between node and its ancestors – Practice here
  4. Min distance between two given nodes of a binary tree – Practice here
  5. Find the number of island – Practice here
  6. Topological Sort – Practice here
  7. Detect cycle in a directed graph – Practice here
  8. Flattening a link list – Practice here
  9. Detect a loop in a linked list – Practice here
  10. Check if a binary tree is BST or not
  11. Min Cost path
  12. Count ways to reach nth stair
  13. Maximum Subarray Problem
  14. Palindrome Partitioning
  15. Given a binary tree find the minimum root to leaf height.
  16. Implement LRU cache

Level – Hard

  1. Boolean paranthesis – Practice here
  2. Maximum Index – Practice here
  3. Largest Number formed in the array – Practice here
  4. Find the length of maximum numbers of consecutive numbers jumped up in an array
  5. Delete the elements in a linklist whose sum is equal to zero
  6. Given a list of numbers of odd length design an algorithm to remove a number and divide the rest numbers equaly so as it makes there sum same
  7. Find diameter of a binary tree
info

Source : Interview tips from amazon team

What more will be asked

multithreading, deadlocks, OOP concepts, shared memory

Some questions on hashing, BFS/DFS tradeoffs and sorting.

Your interview will not be focused on rote memorization of algorithms. However, having a good understanding of the most common algorithms will likely make solving some of the questions a lot easier. Consider reviewing common algorithms such as traversals, divide and conquer, breadth-first search vs. depth-first search and understand the tradeoffs for each. Knowing the runtimes, theoretical limitations, and basic implementation strategies of different classes of algorithms is more important than memorizing the specific details of any given algorithm.

Object Oriented Design

You won’t need to know how to build your own operating system from scratch, but you should be familiar with some OS topics that can affect code performance (e.g. memory management, processes, threads, synchronization, paging, and multithreading).

Online Bookstore Design

  • What kind of Books
  • How many users
  • Number of Transactions
  • App / Web interface

We expect our engineers to be familiar with the fundamentals of how the internet works. Brush up on how browsers function at a high level, from DNS lookups and TCP/IP, to socket connections. Having a solid understanding of the fundamentals of how the worldwide web works is a requirement.

Leadership principles in amazon

Next, dive into our Leadership Principles. We use our Leadership Principles every day, whether we're discussing ideas for new projects or deciding on the best approach to solving a problem. It is just one of the things that makes Amazon peculiar. All candidates are evaluated based on our Leadership Principles. The best way to prepare for your interview is to consider how you’ve applied the Leadership Principles in your previous professional experience.

Customer Obsession

Leaders start with the customer and work backwards. They work vigorously to earn and keep customer trust. Although leaders pay attention to competitors, they obsess over customers.

Ownership

Leaders are owners. They think long term and don’t sacrifice long-term value for short-term results. They act on behalf of the entire company, beyond just their own team. They never say “that’s not my job".

Invent and Simplify

Leaders expect and require innovation and invention from their teams and always find ways to simplify. They are externally aware, look for new ideas from everywhere, and are not limited by “not invented here". As we do new things, we accept that we may be misunderstood for long periods of time.

Are right, A Lot

Leaders are right a lot. They have strong judgment and good instincts. They seek diverse perspectives and work to disconfirm their beliefs.

Learn and Be Curious

Leaders are never done learning and always seek to improve themselves. They are curious about new possibilities and act to explore them.

Hire and Develop the Best

Leaders raise the performance bar with every hire and promotion. They recognize exceptional talent, and willingly move them throughout the organization. Leaders develop leaders and take seriously their role in coaching others. We work on behalf of our people to invent mechanisms for development like Career Choice.

Insist on the Highest Standards

Leaders have relentlessly high standards - many people may think these standards are unreasonably high. Leaders are continually raising the bar and driving their teams to deliver high quality products, services and processes. Leaders ensure that defects do not get sent down the line and that problems are fixed so they stay fixed.

Think Big

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

Bias for Action

Speed matters in business. Many decisions and actions are reversible and do not need extensive study. We value calculated risk taking.

Frugality

Accomplish more with less. Constraints breed resourcefulness, self-sufficiency and invention. There are no extra points for growing headcount, budget size or fixed expense.

Earn Trust

Leaders listen attentively, speak candidly, and treat others respectfully. They are vocally self-critical, even when doing so is awkward or embarrassing. Leaders do not believe their or their team’s body odor smells of perfume. They benchmark themselves and their teams against the best.

Dive Deep

Leaders operate at all levels, stay connected to the details, audit frequently, and are skeptical when metrics and anecdote differ. No task is beneath them.

Have Backbone; Disagree and Commit

Leaders are obligated to respectfully challenge decisions when they disagree, even when doing so is uncomfortable or exhausting. Leaders have conviction and are tenacious. They do not compromise for the sake of social cohesion. Once a decision is determined, they commit wholly.

Deliver Results

Leaders focus on the key inputs for their business and deliver them with the right quality and in a timely fashion. Despite setbacks, they rise to the occasion and never settle.

Our interviews are rooted in behavioral-based questions which ask about past situations or challenges you’ve faced and how you handled them, using Leadership Principles to guide the discussion. We avoid brain teasers (e.g., “How many windows are in Manhattan?”) as part of the interview process. We’ve researched this approach and have found that those types of questions are unreliable when it comes to predicting a candidate’s success at Amazon. Here are some examples of behavioral-based questions:

  • Tell me about a time when you were faced with a problem that had a number of possible solutions. What was the problem and how did you determine the course of action? What was the outcome of that choice?
  • When did you take a risk, make a mistake, or fail? How did you respond, and how did you grow from that experience?
  • Describe a time you took the lead on a project.
  • What did you do when you needed to motivate a group of individuals or promote collaboration on a particular project?
  • How have you leveraged data to develop a strategy? Keep in mind, Amazon is a data-driven company. When you answer questions, your focus should be on the question asked, ensure your answer is well-structured and provide examples using metrics or data if applicable. Reference recent situations whenever possible.

The STAR method is a structured manner of responding to a behavioral-based interview question by discussing the specific situation, task, action, and result of what you're describing. Here’s what it looks like:

SITUATION

Describe the situation that you were in, or the task that you needed to accomplish. Give enough detail for the interviewer to understand the complexities of the situation. This example can be from a previous job, school project, volunteer activity, or any relevant event.

TASK

What goal were you working toward?

ACTION

Describe the actions you took to address the situation with an appropriate amount of detail, and keep the focus on you. What specific steps did you take? What was your particular contribution? Be careful that you don’t describe what the team or group did when talking about a project. Let us know what you actually did. Use the word “I,” not “we,” when describing actions.

RESULT

Describe the outcome of your actions and don’t be shy about taking credit for your behavior. What happened? How did the event end? What did you accomplish? What did you learn? Provide examples using metrics or data if applicable.

Consider your own successes and failures in relation to the Leadership Principles. Have specific examples that showcase your expertise, and demonstrate how you’ve taken risks, succeeded, failed and grown in the process. Keep in mind, some of Amazon’s most successful programs have risen from the ashes of failed projects. Failure is a necessary part of innovation. It’s not optional. We understand that and believe in failing early and iterating until we get it right.

  • Practice using the STAR method to answer the behavioral-based interview questions listed above, incorporating examples from the Amazon Leadership Principles.

  • Ensure each answer has a beginning, middle, and end. Describe the situation or problem, the actions you took, and the outcome.

  • Prepare short descriptions of a handful of different situations and be ready to answer follow-up questions with greater detail. Select examples that highlight your unique skills.

  • Have specific examples that showcase your experience, and demonstrate that you’ve taken risks, succeeded, failed and grown in the process.

  • Specifics are key; avoid generalizations. Give a detailed account of one situation for each question you answer, and use data or metrics to support your example.

  • Be forthcoming and straightforward. Don't embellish or omit parts of the story.

  • Be prepared to explain what interests you about the role you’re interviewing for and the team (or teams) you’ll be meeting with.

  • When answering questions, be concise but detailed. We realize it’s hard to gauge how much information is too much versus not enough. An effective test is pausing after your succinct response to ask if you’ve provided enough detail, or if the interviewer would like you to go into more depth.

  • Follow-up if you need clarification. If you are asked a question, but are not given enough information to provide a solid answer, don’t be shy about asking for more information. If additional context is not available, focus on how you would attempt to solve the problem given limited information.

  • For some roles, we may ask you to complete a writing sample. Why? At Amazon, we don’t do PowerPoint or any other slide oriented 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. Given this unique aspect of our culture, and the impact these papers have on what decisions we make as a company, being able to articulate your thoughts in written format is a necessary skill.

  • We aim to hire smart, thoughtful, and customer-obsessed people. Reflect on what motivated you to pursue a career with Amazon, and be prepared to share your thought process. Although “Why Amazon?” is a standard question, it’s not a formality for us. We genuinely want to understand what inspired you to explore an opportunity with us so we get a better sense of who you are.

  • We try to leave a few minutes at the end of each interview to answer questions you might have, but if we don’t get to all of them, please don’t hesitate to ask your recruiting point of contact.

How to answer behavioral interview questions

If you're preparing for your job interview, you should learn about behavioral interview questions. Don't know what those are? Keep reading.

Do all job interviews have behavioral questions?

Most job interviews in America or at English-speaking companies will be a mix of basic/general/HR questions ("Tell me about yourself." / "Why do you want to work at our company?" / "Why are you leaving your current job?"), questions about your skills and experience/functional questions, and behavioral questions. What are behavioral questions? Behavioral questions are the ones that start with something like, "Give me an example of..." or "Can you tell me about a time..."

10 common behavioral questions

  1. Tell me about a goal you had and how you achieved it.
  2. Tell me about a time you worked on a team.
  3. Share an example of how you were able to motivate an employee or a co-worker.
  4. What was the last project you led and what was the outcome?
  5. Describe a situation when you had to work effectively under pressure.
  6. How do you handle a challenge? Give me an example.
  7. Have you ever had to change the way you communicated with someone?
  8. Tell me about a mistake that you made. How did you handle the situation?
  9. What do you usually do when you disagree with someone at work?
  10. Have you ever had to work with a difficult manager or coworker? How did you respond?

You can see that these questions require you to talk about a specific situation in the past. The interviewer wants examples of how you’ve handled issues in the past so they can guess what you’ll do in a similar situation if they hire you. They think that your past actions predict your future actions.

Use the STAR technique to answer behavioral interview questions

The STAR technique was invented to help you give good answers to behavioral interview questions.

What is the STAR technique?

The STAR technique is a very common system used to answer behavioral interview questions. You can’t use it to answer the basic type of question like “What are your strengths?” STAR provides a structure for you to remember so that you will include the correct information in your answers.  These are the 4 steps of the technique: S – Situation - background info T – Task - what your job was in this situation A – Activity - what you did - this should be the longest part of the answer R – Result - positive; quantifiable; what you learned; what you would do differently next time If you get asked a behavioral question, answer by going through the letters in order. First give the S part (explain the basic situation). Then give the T (what was your job/task in this situation?) Then A (show what you did). Last, give the R (outcome). Tip: Use "I" in your answers. Don't talk about just what your team did, explain what you did.

Sample answer – "Tell me about a goal you had and how you achieved it." S/T – After I got promoted, I realized that we had more projects than originally pIanned and I would need more product managers to complete them. Hiring was my responsibility so I needed to decide how many to hire. A – I charted our planned projects and then decided how many people I thought I needed. I used our records as well as my own observations. I came up with the number of people and then asked my colleagues for their opinions. Once we had a final number I worked with recruiting to interview candidates and eventually hired the right number of people. R - Now we're adequately staffed and the work is going well.  Tip: This is a good answer, but if possible pick an example where you can use numbers in your results. For instance, "And we made 5% more this quarter," or "My sales numbers are up 25% over last year." Numbers, particularly money, make the results more impressive.

Sample answer – "Tell me about a time you had a difficult situation with an employee."  S/T – I recently had an employee, one of my product managers, who was not performing well. The people she worked with were complaining about her attitude and the executives were complaining about the quality of her work. They wanted me to fire her but I wasn't sure that was the right thing to do. A – I talked to HR and the executive team, and we decided to collect the evidence about her performance in a document and then present it to her. I did this. During her review, she was very angry and blamed her problems on the company structure. In the end, we decided that we would closely together for 60 days to improve her performance.  R – My plan was successful in that her performance did improve (as well as her attitude). I'm not happy with the amount of time I have to spend with her, but I hope that by spending the time mentoring her now I will end up with a good product manager who can work independently of me. Tip: Don't pick a situation to talk about that doesn't have a happy ending (or at least shows improvement).

Is there any other structure you can use to answer these questions?

Yes. Personally I prefer PAR as it’s easier to understand.