20+ Amazon SQL Interivew Questions - BA, BI, Data Engineers, and Data Scientist

20+ Amazon SQL Interview Questions for every profession. Includes commonly asked questions to Data Engineers, Data Scientists, BA, and BI Engineers.

amazon sql interview questions

Preparing for an Amazon interview? We spoke to Business Analysts, Data Scientists, and Engineers who recently interviewed at Amazon to source the commonly asked Amazon SQL interview questions.

Before we get into these questions, it is important to note that SQL interview questions at Amazon aren’t necessarily difficult - they are rather designed to gauge your capability to think thoughtfully.

Now, let’s get into the most common questions that were asked in Amazon SQL interviews.

Amazon SQL Interview Question for Business Analysts

Here are the most commonly asked questions to Business Analysts during Amazon’s SQL Interview:

Amazon SQL Interview Question for Business Analyst #1

Question: Get the top 25 highest salaried employees from a table. The table has the following columns: names of employees, salaries, and departments. The total count information was not provided.

Amazon SQL Interview Question for Business Analyst #2

Question: Select all devices that had more than 50,000 streams within the last 15 days.

Amazon SQL Interview Question for Business Analyst #3

Question: Calculate the average cost per view in the last 15 days

Amazon SQL Interview Question for Business Analyst #4

Question: Calculate the unique streams in the last 15 days where the video was purchased in December 2021.

Amazon SQL Interview Question for Business Analyst #5

Question: There are two tables, table_1 with country-specific data and table_2 with other geographical attributes. Perform a LEFT Join and add null if a country does not have any geographical attributes.

Amazon SQL Interview Question for Business Analyst #7

Question: In table_1 we have user ids and different activities performed by those users' ids. Calculate the total counts of activities performed by each user id.

It is important to note that during the interviews, most of these questions were to be solved without any datasets. Amazon’s hiring managers are more interested in understanding your approach to solving these problems.

How to win at these Amazon SQL Interviews? - The key is to help the interviewer understand that you went through 5-8 scenarios to figure out the best way to approach the problem. You should be able to justify your SQL syntax choices well enough.

Tips to perform well in Amazon SQL coding interviews:

  1. Understand Postgre syntax! This is very important as AWS databases follow Postgres syntax.
  2. Get yourself extremely familiar with Amazon’s DBs like RDS, Redshift, Redshift Spectrum, Kinesis stream, DynamoDB, and Athena.
  3. Understand aggregations when using different tables with different granularities.
  4. Learn Window functions and Non-Equi Joins as best as you can.

Amazon SQL Interview Questions for Business Intelligence Positions

We recommend that you check out the questions for BA positions above as they are generally asked to BI Engineers during SQL interviews as well. In addition to those, we recommend that you go through these interview questions too.

Amazon SQL Interview Question for Business Intelligence Engineers #1

Question: Calculate the percentage of users who subscribed after browsing the gallery. The table to be used has the following columns: user_id, user_session, timestamp, subscribed_action, and browsed_action.

Suggested approach: To solve this, we suggest that you SELF JOIN on the last timestamp with limit = 1. Alternatively, you can also JOIN on the row number through the Window function.

Amazon SQL Interview Question for Business Intelligence Engineers #2

Question: You have a table (table_1) that has the following columns: employee_id, employee_name, employee_department, and employee_salary - calculate the gap between the first two highest paid employees’s salary for each department.

Suggested approach: Use a Window function to sort each department and then subtract the first two in each department.

Tips to help you ace Amazon SQL Interviews as a BI Engineer:

  1. Master Window functions.
  2. Learn how to handle tricky questions that are based on top case statements or Self Join.

These SQL Interview questions should help you smoothly overcome any L5 or below-level Business Intelligence Interviews.

Amazon SQL Interview Questions for a Senior Engineer Position

A Senior Engineer at Amazon is expected to be able to answer the questions that a Business Analyst or a Business Intelligence Engineer could answer. In addition to that, you should be able to answer the following SQL questions too:

  1. What is an Inner Join?
  2. What is a Left Join?
  3. What is a Right Join?
  4. What is a Full Join?
  5. Explain Merge Join in SQL.
  6. Explain the difference between Joins and Nested Queries.
  7. What is a Natural Join?
  8. If you are joining a lot of tables, how would you know if you are getting the correct results?
  9. How to deal with expensive SQL Joins?

Copyright ©2024 Workstory Inc.

Facebook
Twitter
LinkedIn