🧩

Data Structures

All levels

Arrays, trees, graphs, heaps — the patterns that appear most frequently at Amazon.

Overview

Key concepts

High-frequency structures

Arrays & strings · Hash maps · Linked lists · Binary trees · Graphs · Stacks & queues · Heaps / priority queues · Tries

Amazon patterns

Two pointers · Sliding window · BFS/DFS · Merge intervals · Tree traversal (inorder, preorder, postorder) · Fast & slow pointers

Question Bank

Practice questions

Common questions asked at Amazon for this topic. Check them off as you practice. Progress is saved in your browser.

0/9 practiced

Two Sum: find two numbers in an array that add up to a target value.

Easy

Find the k most frequent elements in an array.

Medium

Merge k sorted linked lists into one sorted list.

Hard

Design an LRU Cache with O(1) get and put operations.

Medium

Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.

Medium

Number of Islands: count connected groups of '1's in a 2D binary grid.

Medium

Serialize and deserialize a binary tree.

Hard

Merge Intervals: given a list of intervals, merge all overlapping ones.

Medium

Find the median of a data stream as elements are added one at a time.

Hard

Resources

Go deeper

Free, curated materials to supplement your prep.

Previous
System Design
Next
Algorithms