Skip to content

Top 50 DSA Interview Questions for 2026

Data structures and algorithms form the backbone of every technical interview at top tech companies. Whether you are preparing for Google, Amazon, Meta, Microsoft, or any other FAANG company, mastering these 50 questions will put you ahead of 90% of candidates. This curated list covers arrays, linked lists, trees, graphs, dynamic programming, and more — organized by topic with difficulty levels and company frequency tags.

50
Essential Questions
12
DSA Topics
6+
Companies Covered
Free
Full Practice Access

Why DSA Matters in Technical Interviews

Data structures and algorithms (DSA) are the most heavily tested topics in software engineering interviews. Companies like Google, Amazon, and Meta use DSA problems to assess your problem-solving ability, code quality, and understanding of time and space complexity. Unlike system design or behavioral rounds, DSA rounds are pass-or-fail: you either solve the problem or you do not.

The good news is that DSA interviews follow predictable patterns. Over 80% of interview questions are variations of well-known problems. If you master the core patterns — two pointers, sliding window, BFS/DFS, dynamic programming, and binary search — you can solve most interview questions in under 30 minutes.

This list is organized by data structure and algorithm pattern. For each question, we provide the difficulty level, the companies that most frequently ask it, and a direct link to our free learning material. We recommend working through each section in order: start with arrays and strings, then move to linked lists, trees, graphs, and finally dynamic programming.

Jump to Topic

Arrays Questions

#1

Two Sum

Easy GoogleAmazonMeta
#2

Best Time to Buy and Sell Stock

Easy AmazonMetaGoldman Sachs
#3

Contains Duplicate

Easy GoogleAppleMicrosoft
#4

Product of Array Except Self

Medium AmazonMetaApple
#5

Maximum Subarray (Kadane's Algorithm)

Medium GoogleMicrosoftAmazon
#6

Container With Most Water

Medium AmazonGoogleMeta
#7

3Sum

Medium MetaGoogleMicrosoft
#8

Merge Intervals

Medium GoogleAmazonMeta

Linked Lists Questions

#9

Reverse Linked List

Easy AmazonMicrosoftApple
Study Topic →
#10

Merge Two Sorted Lists

Easy AmazonGoogleMeta
Study Topic →
#11

Linked List Cycle Detection

Easy AmazonMicrosoftGoogle
Study Topic →
#12

Remove Nth Node From End of List

Medium MetaAmazonApple
Study Topic →

Stacks & Queues Questions

#13

Valid Parentheses

Easy AmazonMetaGoogle
#14

Min Stack

Medium AmazonGoogleMicrosoft
#15

Implement Queue Using Stacks

Easy MicrosoftAmazonApple

Trees Questions

#16

Maximum Depth of Binary Tree

Easy GoogleAmazonMeta
#17

Validate Binary Search Tree

Medium AmazonMetaMicrosoft
#18

Level Order Traversal

Medium AmazonGoogleMeta
#19

Lowest Common Ancestor of BST

Medium MetaAmazonGoogle
#20

Serialize and Deserialize Binary Tree

Hard AmazonGoogleMeta
#21

Invert Binary Tree

Easy GoogleAmazonApple
#22

Diameter of Binary Tree

Easy MetaAmazonGoogle

Graphs Questions

#23

Number of Islands

Medium AmazonGoogleMeta
Study Topic →
#24

Clone Graph

Medium MetaGoogleMicrosoft
Study Topic →
#25

Course Schedule (Topological Sort)

Medium AmazonGoogleMeta
Study Topic →
#26

Word Ladder

Hard AmazonGoogleMeta
Study Topic →
#27

Pacific Atlantic Water Flow

Medium GoogleAmazonMicrosoft
Study Topic →

Dynamic Programming Questions

#28

Climbing Stairs

Easy AmazonGoogleApple
Study Topic →
#29

Longest Increasing Subsequence

Medium GoogleAmazonMeta
Study Topic →
#30

Coin Change

Medium AmazonGoogleMicrosoft
Study Topic →
#31

House Robber

Medium AmazonGoogleApple
Study Topic →
#32

0/1 Knapsack

Medium AmazonGoogleMicrosoft
Study Topic →
#33

Longest Common Subsequence

Medium GoogleAmazonMeta
Study Topic →
#34

Edit Distance

Hard GoogleAmazonMeta
Study Topic →
#35

Word Break

Medium AmazonMetaGoogle
Study Topic →

Heaps Questions

#36

Kth Largest Element in an Array

Medium AmazonMetaGoogle
#37

Top K Frequent Elements

Medium AmazonGoogleMeta
#38

Merge K Sorted Lists

Hard AmazonGoogleMeta
#39

Find Median from Data Stream

Hard AmazonGoogleMicrosoft

Tries Questions

#43

Implement Trie (Prefix Tree)

Medium GoogleAmazonMicrosoft
#44

Word Search II

Hard AmazonGoogleMeta

Backtracking Questions

#45

Permutations

Medium AmazonGoogleMeta
#46

Subsets

Medium MetaAmazonGoogle
#47

N-Queens

Hard GoogleAmazonMicrosoft

Sliding Window Questions

#48

Longest Substring Without Repeating Characters

Medium AmazonGoogleMeta
#49

Minimum Window Substring

Hard MetaGoogleAmazon

Sorting & Greedy Questions

#50

Meeting Rooms II

Medium GoogleMetaAmazon

How to Prepare for DSA Interviews

Step 1: Learn the Fundamentals

Before diving into problem-solving, make sure you have a solid understanding of core data structures: arrays, linked lists, stacks, queues, hash maps, trees, graphs, heaps, and tries. For each data structure, understand the time complexity of basic operations (insert, delete, search, traverse).

Step 2: Master Algorithm Patterns

Most DSA interview questions can be mapped to one of 15 common patterns: two pointers, sliding window, fast and slow pointers, merge intervals, cyclic sort, in-place reversal of linked list, BFS, DFS, two heaps, subsets, modified binary search, bitwise XOR, top K elements, K-way merge, and topological sort.

Step 3: Practice with a System

Random practice is inefficient. Follow the structure in this list: start with Easy problems in each category, then move to Medium, and finally Hard. Aim to solve 2-3 problems per day. For each problem, spend 20 minutes attempting it before looking at hints. After solving, write out the time and space complexity and explain your approach out loud.

Step 4: Simulate Real Interviews

Once you are comfortable solving Medium problems in 20-25 minutes, start timed practice. Use Guru Sishya's interview mode which simulates real interview conditions with a timer, progressive difficulty, and immediate feedback.

Step 5: Review and Iterate

Track which problems and patterns give you trouble. Guru Sishya's spaced repetition system automatically creates flashcards for problems you get wrong and schedules reviews at optimal intervals. Most successful candidates report that 4-6 weeks of focused preparation (2-3 hours per day) is sufficient to pass DSA rounds at top companies.

Difficulty Breakdown

13
Easy Problems
29
Medium Problems
8
Hard Problems

Related Learning Topics

Ready to Ace Your DSA Interview?

Practice all 50 questions with interactive lessons, quizzes, code playground (Java, Python, JavaScript), and progress tracking — completely free, no signup required.