DSA Sheet from zero to FAANG

This sheet is made for people who want to enter into FAANG companies. This sheet will start with fundamental problems and cover all advanced concepts FAANG companies will ask about.

List of DSA problems

Arrays
Rotate Array
Squares of a sorted array
Maximum and Minimum Element in an Array
Reverse the Array
Kadane’s Algo
Product of Array Except Self
maximum product subarray
majority element
majority element 2
Next Greater Element III
3Sum
Max chunks to make sorted
Max Chunks To Make Sorted II
number of subarrays with bounded maximum
First missing positive
Range Addition
Min No. of Platform
Trapping rain water
Zigzag (or diagonal) Traversal of Matrix
Set Matrix Zeroes
Spiral Matrix
Rotate Image
Word Search
Strings
Remove Consecutive Characters
Valid Anagram
Valid Palindrome
Remove Consecutive Characters
Longest Common Prefix
Convert a Sentence into its Equivalent Mobile Numeric Keypad Sequence
Print all the Duplicates in the Input String
Longest Substring without Repeating Characters
Longest Repeating Character Replacement
Group Anagrams
Longest Palindromic Substring
Palindromic Substrings
Next Permutation
Smallest Window in a String Containing all the Characters of Another String
Count Palindromic Subsequences
Wildcard String Matching
Longest Prefix Suffix
Two Pointers
Container With Most Water
Two Sum
Two Difference
Recursion and BackTracking
Permutations
Permutation Sequence
Combination Sum
Cmbination Sum 2
Letter combination of Phone number
N Queens
Rat in a Maze Path
Bit Manipulation
Single Element
Single Element 2
Single Number 3
Divide 2 Integers
Max AND Pair.
HashMap
Check AP sequence
Grid illumination
Brick wall
Count of subarray with sum = k
Subarray sum divisible by K
Insert Delete GetRandom O(1)
Insert delete get random duplicates allowed
Longest consecutive sequence
Find all anagrams in a string
Find smallest size of string containing all char of other
Write hashmap
subarray with equal number of 0 and 1
Substring with equal 0 1 and 2
Heap
Kth Largest Element
Minimum number of refueling spots
minimum cost to connect sticks
Employee Free time
Find Median from Data Stream
Binary Search
capacity to ship within D days
Painter’s partition problem
search in rotated sorted array
Search in rotated sorted array 2
Allocate books
median of two sorted array
LinkedList
reverse LinkedList
Linked List Cycle
Delete without Head node
Merge Two Sorted Lists
Remove nth node from end of list
Reorder List
Find the middle element
Floyd cycle
Clone a linkedlist
Intersection point of 2 linked list
LRU Cache
Stacks and Queues
Next Greater Element
Largest Rectangular Area Histogram
maximu size binary matrix containing 1
Valid Parentheses
Min Stack
K stacks in a single array
Infix evaluation
K reverse in a queue
K queue
TREES
Preorder Traversal
Inorder Traversal
Postorder Traversal
right side view
Left View
Top View
Bottom View
Vertical order
Diagonal Traversal
Boundary Traversal
Binary Tree Cameras
Max path sum
Delete node in bst
Construct from inorder and preorder
Next right pointer in each node
Convert a binary tree to circular doubly linked list
Conversion of sorted DLL to BST
Lowest common ancestor
serialize and deserialise
Trie
Implement Trie
Max XOR of two numbers in an array
Maximum XOR with an element from Array
DP
longest increasing subsequence
longest increasing subsequence
building bridges
Russian doll envelopes
Box stacking
Paint house
No. of binary string without consecutive 1
Possible ways to construct the building
Total no. of bst
No. of balanced parentheses sequence
Min cost path
Cherry pickup
Cherry pickup 2
best time to buy and sell stock
best time to buy and sell 2
buy and sell with transaction fee
best time to buy and sell with cool down
best time to buy and sell 3
best time to but and sell 4
burst balloons
Optimal BST
Matrix chain multiplication
Longest common subsequence
Count all pallindromic subsequence
Count distinct pallindromic subsequence
No. of sequence of type a^i+b^j+c^k
2 egg 100 floor
egg drop
Regular Expression Matching
Palindrome partitioning
Frog jump
Edit Distance
0-1 Knapsack
unbounded knapsack
Fractional knapsack
Coin change combination
Coin change permutation
GRAPHS
Number of Islands
Number of Distinct Islands
Rotting Oranges
Bipartite graph
Bus routes
Prim’s Algo
Dijkstra algo
swim in rising water
0-1 matrix
bellman ford
Strongly Connected Components (Kosaraju’s Algo)
Mother Vertex
Kahn’s algo
Alien Dictionary
Number of Islands II
Regions Cut By Slashes
Sentence Similarity II
Redundant Connection
Redundant connection 2
Articulation point
Min swaps required to sort array
Sliding Puzzle
Floyd Warshall
remove max number of edges to keep graph traversal

Tips for solving DSA problems

Study Algorithms and Data Structures:

  • Understand the theory behind common algorithms (sorting, searching, etc.) and data structures (trees, graphs, etc.).
  • Implement these from scratch to get a deeper understanding.

Practice Regularly:

  • Solve problems from different categories (arrays, strings, linked lists, trees, graphs, dynamic programming, etc.).
  • Use platforms like LeetCode, HackerRank, CodeSignal, and others to practice.

Analyze Your Mistakes:

  • Review and understand any mistakes you make.
  • Learn why your initial approach didn’t work and how you can improve it.

Stay Consistent:

  • Consistency is key. Regular practice and studying will improve your skills over time.
  • Set a routine for daily or weekly practice.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top