Amazon SDE Sheet: Interview Questions and Answers

Last Updated : 6 Aug, 2026

Amazon coding interviews assess a candidate's proficiency in Data Structures, Algorithms, and problem-solving through topic-wise programming challenges. This sheet provides a structured collection of the most frequently asked Amazon coding questions organized by core DSA topics.

  • Covers Amazon coding questions categorized by topics such as Arrays, Strings, Linked Lists, Trees, Graphs, Dynamic Programming, and more.
  • Includes optimized solutions with detailed explanations to strengthen coding skills and interview preparation.

Array

An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.

String

String are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’.

Linked List

Linked List is the data structure that can overcome all the limitations of an array. A Linked list is a linear data structure, in which the elements are not stored at contiguous memory locations, it allocates memory dynamically.

Searching

Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored.

Sorting

A Sorting Algorithm is used to rearrange a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.

Stack

A stack is a linear data structure in which elements can be inserted and deleted only from one side of the list, called the top. A stack follows the LIFO (Last In First Out) principle.

Queue

A Queue is a linear data structure in which elements can be inserted only from one side of the list called rear, and the elements can be deleted only from the other side called the front. The queue data structure follows the FIFO (First In First Out) principle.

Tree

A tree is non-linear and a hierarchical data structure consisting of a collection of nodes such that each node of the tree stores a value, a list of references to nodes (the “children”).

Graph

A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are lines or arcs that connect any two nodes in the graph.

Trie

Trie is an efficient information retrieval data structure. Using Trie, search complexities can be brought to optimal limit (key length).

Heap and Hash

A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Heap and hash is an efficient implementation of a priority queue. The linear hash function monotonically maps keys to buckets, and each bucket is a heap.

BitMagic

Bit stands for binary digit. A bit is the basic unit of information and can only have one of two possible values that is 0 or 1.

Recursion and Backtracking

Recursion: The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function.

Backtracking: Backtracking is an algorithmic technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point in time (by time, here, is referred to the time elapsed till reaching any level of the search tree).

Dynamic Programming

Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming.

Comment