Amazon logo

Amazon Backend Engineer Interview Questions

40 practice questions for Amazon Backend Engineer interviews

Amazon backend engineer interviews typically focus on APIs, databases, system design, concurrency, caching, and data structures.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. Binary Tree Cameras


Category: Binary tree coding problem
You are given the root of a binary tree. You need to install the minimum number of cameras on the tree nodes such that every node in the tree is...
Input: Binary tree
Output: Integer
coding Hard Verified Question #2

2. [CodeSignal] Warehouse Emergency Deliveries


Category: Array coding problem
Amazon has opened a new warehouse recently. There are no products in the warehouse currently. The warehouse is under inspection for n days. The...
Input: Array
Output: Integer
coding Hard Verified Question #3

3. [CodeSignal] Permutation Sorter


Category: Combinatorics coding problem
Amazon engineers are testing a new tool, the Permutation Sorter, built to reorder sequences using limited operations. Given a permutation of...
Input: Integer(s)
Output: Integer
coding Hard Verified Question #4

4. [CodeSignal] Maximum Product Rating


Category: Array coding problem
The engineers at Amazon are working on a new rating system for their products. For each product, an array customer_rating is maintained for the...
Input: Array
Output: Computed result
coding Medium Verified Question #5

5. [CodeSignal] Drone Hub Travel


Category: Array coding problem
Amazon is expanding its next-generation drone delivery network, consisting of m hubs arranged in a circular ring (Hub 1 is adjacent to Hub m)....
Input: Array
Output: Computed result
coding Medium Verified Question #6

6. [CodeSignal] Minimum Security Groups


Category: Array coding problem
A financial services company has requested AWS for a private deployment of its cloud network. There are n servers in the network where the security...
Input: Array
Output: Integer
coding Medium Verified Question #7

7. [CodeSignal] Maximum Secure Deliveries


Category: Array coding problem
You are given an array deliveryLogs of size n, where each element represents the number of parts delivered in the i-th log. You are also given...
Input: Array
Output: Integer
coding Medium Verified Question #8

8. Maximum Interval Overlap


Category: Interval-based coding problem
You are given a list of closed intervals on the number line, where each interval [start, end] includes both endpoints. Find the maximum number of...
Input: List
Output: Integer
system design Senior messaging #1

1. [OA] Messaging Queue — Implementing a Stream Processing Service for Amazon

To handle asynchronous processing in Amazon's services, we need a robust messaging queue service.
Problem statement: Design a MessageQueue class that supports the following methods:
- void send(string message): to add a new message to the queue.
- string receive(): to retrieve and remove a message from the front of the queue, returns an empty string if the queue is empty.
- int size(): returns the number of messages currently in the queue.
Example 1:
Input: MessageQueue mq = new MessageQueue();
mq.send("msg1");
Output: null
mq.send("msg2");
Output: null
mq.receive();
Output: "msg1"
mq.size();
Output: 1
Constraints:
- The number of messages will not exceed 10^4.
system design Senior api design #2

2. [OA] RateLimiter — Design a Service to Control API Requests

To maintain the performance of APIs across Amazon's services, implementing a rate limiting mechanism is crucial.
Problem statement: Design a RateLimiter class that controls requests to an API. It should allow a maximum of limit requests per second. Implement the following methods:
- bool allowRequest(string userId): returns true if the request should be allowed.
- int getRequestCount(string userId): returns the number of requests made by the user in the last second.
Example 1:
Input: RateLimiter rateLimiter = new RateLimiter(5);
rateLimiter.allowRequest("user1");
Output: true
rateLimiter.allowRequest("user1");...
// After 6 calls, the 6th should return false
Output: false
Constraints:
- 1 <= limit <= 100
- 1 <= userId.length <= 30.
coding Hard dynamic programming #3

3. [OA] Longest Increasing Subsequence — Optimize Amazon's Product Variant Matching

In Amazon's catalog, we need to efficiently match variants of products based on their attributes.
Problem statement: Given an array of integers nums, represents product variant IDs, find the length of the longest increasing subsequence. Assume each variant ID is a unique identifier.
Example 1:
Input: nums = [10, 9, 2, 5, 3, 7, 101, 18]
Output: 4
Explanation: The longest increasing subsequence is [2, 3, 7, 101], which has a length of 4.
Constraints:
- 1 <= nums.length <= 2500
- -10^4 <= nums[i] <= 10^4.
coding Hard graph #4

4. [OA] Dijkstra’s Algorithm — Optimize Amazon's Delivery Route

Amazon needs efficient delivery routing to ensure timely package delivery across its vast logistics network.
Problem statement: Given a graph represented by an adjacency matrix graph, where each element represents the distance between two delivery hubs, implement a function to determine the shortest path from a starting hub to all other hubs. Return an array containing the shortest distance from the start hub to each hub.
Example 1:
Input: graph = [[0, 1, 4, inf], [1, 0, 2, 6], [4, 2, 0, 3], [inf, 6, 3, 0]], start = 0
Output: [0, 1, 3, 6]
Explanation: The shortest distance from hub 0 to hub 1 is 1, to hub 2 is 3, and to hub 3 is 6.
Constraints:
- 1 <= number of hubs <= 100
- 0 <= graph[i][j] <= 10^5
- graph[i][i] == 0.

Related Amazon Backend Engineer interview prep

Start practicing Amazon questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free