Ace DSA Coding Interviews with 14 Patterns & Blind 75+
Welcome to the DSA Interviews Beginner's Guide , where we will discuss the most essential coding interview problems solved in Python , Java , C++ , and JavaScript . This repository includes solutions for 83 problems , categorized based on topics, difficulty, and coding patterns.
The repository is organized into a table format with the following columns:
S No : Serial number for easy reference.
Problem : The problem title, linked to its detailed blog post.
Category : The type of problem (e.g., Array, String, Graph).
Pattern : The underlying coding pattern (e.g., Sliding Window, DFS/BFS).
Difficulty : The difficulty level (Easy, Medium, Hard).
Resources :
LeetCode : Direct link to the problem on LeetCode.
Solution : Link to the respective solution file in this repository.
Blog : Link to a detailed blog post for better understanding.
Browse the table below for the problem you're interested in.
Click on the links under Resources to access the respective content.
S No
Problem
Category
Pattern
Difficulty
Resources
1
1 - Two Sum
Array
Manipulation / Hashing
Easy
LeetCode , Solution , Blog
2
217 - Contains Duplicate
Array
Manipulation / Hashing
Easy
LeetCode , Solution , Blog
3
242 - Valid Anagram
String
Manipulation / Hashing
Easy
LeetCode , Solution , Blog
4
49 - Group Anagrams
String
Manipulation / Hashing
Medium
LeetCode , Solution , Blog
5
347 - Top K Frequent Elements
Array
Manipulation / Hashing
Medium
LeetCode , Solution , Blog
6
392 - Is Subsequence
String
Manipulation / Hashing
Easy
LeetCode , Solution , Blog
7
128 - Longest Consecutive Sequence
Array
Manipulation / Hashing
Medium
LeetCode , Solution , Blog
8
238 - Product of Array Except Self
Array
Manipulation / Hashing
Medium
LeetCode , Solution , Blog
9
125 - Valid Palindrome
String
Two Pointers
Easy
LeetCode , Solution , Blog
10
167 - Two Sum II - Input Array Is Sorted
Array
Two Pointers
Medium
LeetCode , Solution , Blog
11
15 - 3Sum
Array
Two Pointers
Medium
LeetCode , Solution , Blog
12
11 - Container With Most Water
Array
Two Pointers
Medium
LeetCode , Solution , Blog
13
643 - Maximum Average Subarray I
Array
Sliding Window
Easy
LeetCode , Solution , Blog
14
121 - Best Time to Buy and Sell Stock
Array
Sliding Window
Easy
LeetCode , Solution , Blog
15
424 - Longest Repeating Character Replacement
String
Sliding Window
Medium
LeetCode , Solution , Blog
16
3 - Longest Substring Without Repeating Characters
String
Sliding Window
Medium
LeetCode , Solution , Blog
17
76 - Minimum Window Substring
String
Sliding Window
Hard
LeetCode , Solution , Blog
18
876 - Middle of the Linked List
Linked List
Fast & Slow Pointers
Easy
LeetCode , Solution , Blog
19
141 - Linked List Cycle
Linked List
Fast & Slow Pointers
Easy
LeetCode , Solution , Blog
20
142 - Linked List Cycle II
Linked List
Fast & Slow Pointers
Medium
LeetCode , Solution , Blog
21
206 - Reverse Linked List
Linked List
Fast & Slow Pointers
Easy
LeetCode , Solution , Blog
22
143 - Reorder List
Linked List
Fast & Slow Pointers
Medium
LeetCode , Solution , Blog
23
19 - Remove Nth Node From End of List
Linked List
Fast & Slow Pointers
Medium
LeetCode , Solution , Blog
24
21 - Merge Two Sorted Lists
Linked List
Fast & Slow Pointers
Easy
LeetCode , Solution , Blog
25
23 - Merge K Sorted Lists
Linked List
Fast & Slow Pointers
Hard
LeetCode , Solution , Blog
26
20 - Valid Parentheses
Stack
Stack / Monotonic Stack
Easy
LeetCode , Solution , Blog
27
739 - Daily Temperatures
Stack
Stack / Monotonic Stack
Medium
LeetCode , Solution , Blog
28
704 - Binary Search
Binary Search
Binary Search
Easy
LeetCode , Solution , Blog
29
153 - Find Minimum in Rotated Sorted Array
Binary Search
Binary Search
Medium
LeetCode , Solution , Blog
30
33 - Search in Rotated Sorted Array
Binary Search
Binary Search
Medium
LeetCode , Solution , Blog
31
226 - Invert Binary Tree
Trees
DFS / BFS
Easy
LeetCode , Solution , Blog
32
104 - Maximum Depth of Binary Tree
Trees
DFS / BFS
Easy
LeetCode , Solution , Blog
33
100 - Same Tree
Trees
DFS / BFS
Easy
LeetCode , Solution , Blog
34
572 - Subtree of Another Tree
Trees
DFS / BFS
Easy
LeetCode , Solution , Blog
35
235 - Lowest Common Ancestor of a Binary Search Tree
Trees
DFS / BFS
Medium
LeetCode , Solution , Blog
36
102 - Binary Tree Level Order Traversal
Trees
DFS / BFS
Medium
LeetCode , Solution , Blog
37
98 - Validate Binary Search Tree
Trees
DFS / BFS
Medium
LeetCode , Solution , Blog
38
230 - Kth Smallest Element in a BST
Trees
DFS / BFS
Medium
LeetCode , Solution , Blog
39
105 - Construct Binary Tree from Preorder and Inorder Traversal
Trees
DFS / BFS
Medium
LeetCode , Solution , Blog
40
124 - Binary Tree Maximum Path Sum
Trees
DFS / BFS
Hard
LeetCode , Solution , Blog
41
297 - Serialize and Deserialize Binary Tree
Trees
DFS / BFS
Hard
LeetCode , Solution , Blog
42
39 - Combination Sum
Backtracking
Backtracking / DFS
Medium
LeetCode , Solution , Blog
43
79 - Word Search
Backtracking
Backtracking / DFS
Medium
LeetCode , Solution , Blog
44
208 - Implement Trie (Prefix Tree)
Tries
Tries / DFS
Medium
LeetCode , Solution , Blog
45
211 - Design Add and Search Words Data Structure
Tries
Tries / DFS
Medium
LeetCode , Solution , Blog
46
212 - Word Search II
Tries
Tries / DFS
Hard
LeetCode , Solution , Blog
47
295 - Find Median from Data Stream
Heap
Priority Queue
Hard
LeetCode , Solution , Blog
48
200 - Number of Islands
Graphs
DFS / BFS / Union Find
Medium
LeetCode , Solution , Blog
49
133 - Clone Graph
Graphs
DFS / BFS / Union Find
Medium
LeetCode , Solution , Blog
50
417 - Pacific Atlantic Water Flow
Graphs
DFS / BFS / Union Find
Medium
LeetCode , Solution , Blog
51
261 - Graph Valid Tree
Graphs
DFS / BFS / Union Find
Medium
LintCode , Solution , Blog
52
323 - Number of Connected Components in an Undirected Graph
Graphs
DFS / BFS / Union Find
Medium
LintCode , Solution , Blog
53
207 - Course Schedule
Graphs
DFS / BFS / Union Find
Medium
LeetCode , Solution , Blog
54
269 - Alien Dictionary
Graphs
DFS / BFS / Union Find
Hard
LintCode , Solution , Blog
55
509 - Fibonacci Number
Dynamic Programming
Memoization / Tabulation
Easy
LeetCode , Solution , Blog
56
322 - Coin Change
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
57
70 - Climbing Stairs
Dynamic Programming
Memoization / Tabulation
Easy
LeetCode , Solution , Blog
58
198 - House Robber
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
59
213 - House Robber II
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
60
647 - Palindromic Substrings
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
61
5 - Longest Palindromic Substring
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
62
152 - Maximum Product Subarray
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
63
91 - Decode Ways
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
64
139 - Word Break
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
65
300 - Longest Increasing Subsequence
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
66
1143 - Longest Common Subsequence
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
67
62 - Unique Paths
Dynamic Programming
Memoization / Tabulation
Medium
LeetCode , Solution , Blog
68
881 - Boats to Save People
Greedy
Greedy Algorithm
Medium
LeetCode , Solution , Blog
69
53 - Maximum Subarray
Greedy
Greedy Algorithm
Medium
LeetCode , Solution , Blog
70
55 - Jump Game
Greedy
Greedy Algorithm
Medium
LeetCode , Solution , Blog
71
56 - Merge Intervals
Intervals
Merge Intervals
Medium
LeetCode , Solution , Blog
72
57 - Insert Interval
Intervals
Merge Intervals
Medium
LeetCode , Solution , Blog
73
435 - Non-overlapping Intervals
Intervals
Merge Intervals
Medium
LeetCode , Solution , Blog
74
252 - Meeting Rooms
Intervals
Merge Intervals
Easy
LintCode , Solution , Blog
75
253 - Meeting Rooms II
Intervals
Merge Intervals
Medium
LintCode , Solution , Blog
76
48 - Rotate Image
Math & Geometry
Matrix / Math
Medium
LeetCode , Solution , Blog
77
54 - Spiral Matrix
Math & Geometry
Matrix / Math
Medium
LeetCode , Solution , Blog
78
73 - Set Matrix Zeroes
Math & Geometry
Matrix / Math
Medium
LeetCode , Solution , Blog
79
338 - Counting Bits
Binary
Bit Manipulation
Easy
LeetCode , Solution , Blog
80
268 - Missing Number
Binary
Bit Manipulation
Easy
LeetCode , Solution , Blog
81
191 - Number of 1 Bits
Binary
Bit Manipulation
Easy
LeetCode , Solution , Blog
82
190 - Reverse Bits
Binary
Bit Manipulation
Easy
LeetCode , Solution , Blog
83
371 - Sum of Two Integers
Binary
Bit Manipulation
Medium
LeetCode , Solution , Blog
This repository contains solutions in:
Python
Java
C++
JavaScript
๐ ๏ธ Practice/Progress Tracker
Practice/Progress Tracker: Unwired Learning