Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

DSA Sheet by Love Babbar

  • Difficulty Level : Medium
  • Last Updated : 16 May, 2022

Who is Love Babbar?

Love Babbar is a famous Youtuber, a graduate from NSUT Delhi who has also worked as a Software Engineer in Amazon.

What is a DSA Sheet?

A sheet that covers almost every concept of Data Structures and Algorithms.
DSA Sheet

So, this DSA sheet by Love Babbar contains 450 coding questions which will help in:

  • Understanding each and every concept of DSA.
  • Clearing the DSA round for the Interviews, as these are the questions generally asked in the companies like Amazon, Microsoft, Google, etc.
    Pre-requisites for DSA sheet:

  • Basic Knowledge of Data Structures and Algorithms.
  • Having good knowledge of at-least one programming knowledge like C++, Java, Python.
  • Know how to use STL as it will make data structures and few techniques easier to implement.

Below is the topic-wise distribution of 450 questions:


This sheet can be completed within 2-3 months without any cheat day.

So, Start solving this 450 DSA Cracker from today itself.
Keep a track of all the problems mentioned below: Practice Love Babbar DSA Sheet


Reverse the arrayLinkLink
Find the maximum and minimum element in an arrayLinkLink
Find the “Kth” max and min element of an arrayLinkLink
Given an array which consists of only 0, 1 and 2. Sort the array without using any sorting algoLinkLink
Move all the negative elements to one side of the arrayLinkLink
Find the Union and Intersection of the two sorted arrays.LinkLink
Write a program to cyclically rotate an array by one.LinkLink
Find Largest sum contiguous Subarray [V. IMP]LinkLink
Minimize the maximum difference between heights [V.IMP]LinkLink
Minimum no. of Jumps to reach end of an arrayLinkLink
Find duplicate in an array of N+1 IntegersLinkLink
Merge 2 sorted arrays without using Extra space.LinkLink
Kadane’s Algo [V.V.V.V.V IMP]LinkLink
Merge IntervalsLinkLink
Next PermutationLinkLink
Count InversionLinkLink
Best time to buy and Sell stockLinkLink
Find all pairs on integer array whose sum is equal to given numberLinkLink
Find common elements In 3 sorted arraysLinkLink
Rearrange the array in alternating positive and negative items with O(1) extra spaceLinkLink
Find if there is any subarray with sum equal to 0LinkLink
Find factorial of a large numberLinkLink
Find maximum product subarrayLinkLink
Find longest consecutive subsequenceLinkLink
Given an array of size n and a number k, fin all elements that appear more than ” n/k ” times.LinkNA
Maximum profit by buying and selling a share at most twiceLinkLink
Find whether an array is a subset of another arrayLinkLink
Find the triplet that sum to a given valueLinkLink
Trapping Rain water problemLinkLink
Chocolate Distribution problemLinkLink
Smallest Subarray with sum greater than a given valueLinkLink
Three way partitioning of an array around a given valueLinkLink
Minimum swaps required bring elements less equal K togetherLinkLink
Minimum no. of operations required to make an array palindromeLinkLink
Median of 2 sorted arrays of equal sizeLinkLink
Median of 2 sorted arrays of different sizeLinkLink


Spiral traversal on a MatrixLinkLInk
Search an element in a MatrixLinkLink
Find median in a row wise sorted matrixLinkLink
Find row with maximum no. of 1’sLinkLink
Print elements in sorted order using row-column wise sorted matrixLinkLink
Maximum size rectangleLinkLink
Find a specific pair in matrixLinkNA
Rotate matrix by 90 degreesLinkLink
Kth smallest element in a row-column wise sorted matrixLinkLink
Common elements in all rows of a given matrixLinkLink


Reverse a StringLinkLink
Check whether a String is Palindrome or notLinkLink
Find Duplicate characters in a stringLinkNA
Why strings are immutable in Java?LinkNA
Write a Code to check whether one string is a rotation of anotherLinkLink
Write a Program to check whether a string is a valid shuffle of two strings or notLinkNA
Count and Say problemLinkLink
Write a program to find the longest Palindrome in a string.[ Longest palindromic Substring]LinkLink
Find Longest Recurring Subsequence in StringLinkLink
Print all Subsequences of a string.LinkNA
Print all the permutations of the given stringLinkLink
Split the Binary string into two substring with equal 0’s and 1’sLinkNA
Word Wrap Problem [VERY IMP].LinkLink
EDIT Distance [Very Imp]LinkLink
Find next greater number with same set of digits. [Very Very IMP]LinkLink
Balanced Parenthesis problem.[Imp]LinkLink
Word break Problem[ Very Imp]LinkLink
Rabin Karp AlgorithmLinkLink
KMP AlgorithmLinkLink
Convert a Sentence into its equivalent mobile numeric keypad sequence.LinkLink
Minimum number of bracket reversals needed to make an expression balanced.LinkLink
Count All Palindromic Subsequence in a given String.LinkLink
Count of number of given string in 2D character arrayLinkLink
Search a Word in a 2D Grid of characters.LinkLink
Boyer Moore Algorithm for Pattern Searching.LinkLink
Converting Roman Numerals to DecimalLinkLink
Longest Common PrefixLinkLink
Number of flips to make binary string alternateLinkLink
Find the first repeated word in string.LinkLink
Minimum number of swaps for bracket balancing.LinkLink
Find the longest common subsequence between two strings.LinkLink
Program to generate all possible valid IP addresses from given  string.LinkLink
Write a program to find the smallest window that contains all characters of string itself.LinkLink
Rearrange characters in a string such that no two adjacent are sameLinkLink
Minimum characters to be added at front to make string palindromeLinkLink
Given a sequence of words, print all anagrams togetherLinkLink
Find the smallest window in a string containing all characters of another stringLinkLink
Recursively remove all adjacent duplicatesLinkLink
String matching where one string contains wildcard charactersLinkLink
Function to find Number of customers who could not get a computerLinkNA
Transform One String to Another using Minimum Number of Given OperationLinkLink
Check if two given strings are isomorphic to each otherLinkLink
Recursively print all sentences that can be formed from list of word listsLinkNA

Searching and Sorting:

Find first and last positions of an element in a sorted arrayLinkLink
Find a Fixed Point (Value equal to index) in a given arrayLinkLink
Search in a rotated sorted arrayLinkLink
Square root of an integerLinkLink
Maximum and minimum of an array using minimum number of comparisonsLinkLink
Optimum location of point to minimize total distanceLinkLink
Find the repeating and the missingLinkLink
Find majority elementLinkLink
Searching in an array where adjacent differ by at most kLinkLink
Find a pair with a given differenceLinkLink
Find four elements that sum to a given valueLinkLink
Maximum sum such that no 2 elements are adjacentLinkLink
Count triplet with sum smaller than a given valueLinkLink
Merge 2 sorted arraysLinkLink
Product array PuzzleLinkLink
Sort array according to count of set bitsLinkLink
Minimum no. of swaps required to sort the arrayLinkLink
Bishu and SoldiersLinkLink
Rasta and KheshtakLinkLink
Kth smallest number againLinkLink
Find pivot element in a sorted arrayLinkLink
K-th Element of Two Sorted ArraysLinkLink
Aggressive cowsLinkLink
Book Allocation ProblemLinkLink
Job Scheduling AlgoLinkLink
Missing Number in APLinkLink
Smallest number with atleast n trailing zeroes in factorialLinkLink
Painters Partition Problem:LinkLink
ROTI-Prata SPOJLinkLink
DoubleHelix SPOJLinkLink
Subset SumsLinkLink
Find the inversion countLinkLink
Implement Merge-sort in-placeLinkLink
Partitioning and Sorting Arrays with Many Repeated EntriesLinkLink


Write a Program to reverse the Linked List. (Both Iterative and recursive)LinkLink
Reverse a Linked List in group of Given Size. [Very Imp]LinkLink
Write a program to Detect loop in a linked list.LinkLink
Write a program to Delete loop in a linked list.LinkLink
Find the starting point of the loop.LinkLink
Remove Duplicates in a sorted Linked List.LinkLink
Remove Duplicates in a Un-sorted Linked List.LinkLink
Write a Program to Move the last element to Front in a Linked List.LinkLink
Add “1” to a number represented as a Linked List.LinkLink
Add two numbers represented by linked lists.LinkLink
Intersection of two Sorted Linked List.LinkLink
Intersection Point of two Linked Lists.LinkLink
Merge Sort For Linked lists.[Very Important]LinkLink
Quicksort for Linked Lists.[Very Important]LinkLink
Find the middle Element of a linked list.LinkLink
Check if a linked list is a circular linked list.LinkLink
Split a Circular linked list into two halves.LinkLink
Write a Program to check whether the Singly Linked list is a palindrome or not.LinkLink
Deletion from a Circular Linked List.LinkLink
Reverse a Doubly Linked list.LinkLink
Find pairs with a given sum in a DLL.LinkLink
Count triplets in a sorted DLL whose sum is equal to given value “X”.LinkLink
Sort a “k”sorted Doubly Linked list.[Very IMP]LinkLink
Rotate Doubly Linked list by N nodes.LinkLink
Rotate a Doubly Linked list in group of Given Size.[Very IMP]LinkLink
Can we reverse a linked list in less than O(n) ?LinkLink
Why Quicksort is preferred for. Arrays and Merge Sort for Linked Lists ?LinkLink
Flatten a Linked ListLinkLink
Sort a LL of 0’s, 1’s and 2’sLinkLink
Clone a linked list with next and random pointerLinkLink
Merge K sorted Linked listLinkLink
Multiply 2 no. represented by LLLinkLink
Delete nodes which have a greater value on right sideLinkLink
Segregate even and odd nodes in a Linked ListLinkLink
Program for n’th node from the end of a Linked ListLinkLink

Bit Manipulation:

Count set bits in an integerLinkLink
Find the two non-repeating elements in an array of repeating elementsLinkLink
Count number of bits to be flipped to convert A to BLinkLink
Count total set bits in all numbers from 1 to nLinkLink
Program to find whether a no is power of twoLinkLink
Find position of the only set bitLinkLink
Copy set bits in a rangeLinkLink
Divide two integers without using multiplication, division and mod operatorLinkLink
Calculate square of a number without using *, / and pow()LinkLink
Power SetLinkLink


Activity Selection ProblemLinkLink
Job Sequencing ProblemLinkLink
Huffman CodingLinkLink
Water Connection ProblemLinkLink
Fractional Knapsack ProblemLinkLink
Greedy Algorithm to find Minimum number of CoinsLinkLink
Maximum trains for which stoppage can be providedLinkLink
Minimum Platforms ProblemLinkLink
Buy Maximum Stocks if i stocks can be bought on i-th dayLinkLink
Find the minimum and maximum amount to buy all N candiesLinkLink
Minimize Cash Flow among a given set of friends who have borrowed money from each otherLinkLink
Minimum Cost to cut a board into squaresLinkLink
Check if it is possible to survive on IslandLinkLink
Find maximum meetings in one roomLinkLink
Maximum product subset of an arrayLinkLink
Maximize array sum after K negationsLinkLink
Maximize the sum of arr[i]*iLinkLink
Maximum sum of absolute difference of an arrayLinkLink
Maximize sum of consecutive differences in a circular arrayLinkLink
Minimum sum of absolute difference of pairs of two arraysLinkLink
Program for Shortest Job First (or SJF) CPU SchedulingLinkLink
Program for Least Recently Used (LRU) Page Replacement algorithmLinkLink
Smallest subset with sum greater than all other elementsLinkLink
Chocolate Distribution ProblemLinkLink
DEFKIN -Defense of a KingdomLinkLink
GERGOVIA -Wine trading in GergoviaLinkLink
Picking Up ChicksLinkLink
CHOCOLA –ChocolateLinkLink
ARRANGE -Arranging AmplifiersLinkLink
K Centers ProblemLinkLink
Minimum Cost of ropesLinkLink
Find smallest number with given number of digits and sum of digitsLinkLink
Rearrange characters in a string such that no two adjacent are sameLinkLink
Find maximum sum possible equal sum of three stacksLinkLink


Rat in a maze ProblemLinkLink
Printing all solutions in N-Queen LinkLink
Word Break Problem using BacktrackingLinkLink
Remove Invalid ParenthesesLinkLink
Sudoku SolverLinkLink
M Coloring ProblemLinkLink
Print all palindromic partitions of a stringLinkLink
Subset Sum ProblemLinkLink
The Knight’s tour problemLinkLink
Tug of WarLinkLink
Find shortest safe route in a path with landminesLinkLink
Combinational SumLinkLink
Find Maximum number possible by doing at-most K swapsLinkLink
Print all permutations of a stringLinkLink
Find if there is a path of more than k length from a sourceLinkLink
Longest Possible Route in a Matrix with HurdlesLinkLink
Print all possible paths from top left to bottom right of a mXn matrixLinkLink
Partition of a set into K subsets with equal sumLinkLink
Find the K-th Permutation Sequence of first N natural numbersLinkLink

Dynamic Programming:

Coin Change ProblemLinkLink
Knapsack ProblemLinkLink
Binomial Coefficient ProblemLinkLink
Permutation Coefficient ProblemLinkLink
Program for nth Catalan NumberLinkLink
Matrix Chain MultiplicationLinkLink
Edit DistanceLinkLink
Subset Sum ProblemLinkLink
Friends Pairing ProblemLinkLink
Gold Mine ProblemLinkLink
Assembly Line Scheduling ProblemLinkLink
Painting the Fence problemLinkLink
Maximize The Cut SegmentsLinkLink
Longest Common SubsequenceLinkLink
Longest Repeated SubsequenceLinkLink
Longest Increasing SubsequenceLinkLink
Space Optimized Solution of LCSLinkLink
LCS (Longest Common Subsequence) of three stringsLinkLink
Maximum Sum Increasing SubsequenceLinkLink
Count all subsequences having product less than KLinkLink
Longest subsequence such that difference between adjacent is oneLinkLink
Maximum subsequence sum such that no three are consecutiveLinkLink
Egg Dropping ProblemLinkLink
Maximum Length Chain of PairsLinkLink
Maximum size square sub-matrix with all 1sLinkLink
Maximum sum of pairs with specific differenceLinkLink
Min Cost Path ProblemLinkLink
Maximum difference of zeros and ones in binary stringLinkLink
Minimum number of jumps to reach endLinkLink
Minimum cost to fill given weight in a bagLinkLink
Minimum removals from array to make max –min <= KLinkLink
Longest Common SubstringLinkLink
Count number of ways to reach a given score in a gameLinkLink
Count Balanced Binary Trees of Height hLinkLink
LargestSum Contiguous Subarray [V>V>V>V IMP ]LinkLink
Smallest sum contiguous subarrayLinkLink
Unbounded Knapsack (Repetition of items allowed)LinkLink
Word Break ProblemLinkLink
Largest Independent Set ProblemLinkLink
Partition problemLinkLink
Longest Palindromic SubsequenceLinkLink
Count All Palindromic Subsequence in a given StringLinkLink
Longest Palindromic SubstringLinkLink
Longest alternating subsequenceLinkLink
Weighted Job SchedulingLinkLink
Coin game winner where every player has three choicesLinkLink
Count Derangements (Permutation such that no element appears in its original position) [ IMPORTANT ]LinkLink
Maximum profit by buying and selling a share at most twice [ IMP ]LinkLink
Optimal Strategy for a GameLinkLink
Optimal Binary Search TreeLinkLink
Palindrome Partitioning ProblemLinkLink
Word Wrap ProblemLinkLink
Mobile Numeric Keypad Problem [ IMP ]LinkLink
Boolean Parenthesization ProblemLinkLink
Largest rectangular sub-matrix whose sum is 0LinkLink
Largest area rectangular sub-matrix with equal number of 1’s and 0’s [ IMP ]LinkLink
Maximum sum rectangle in a 2D matrixLinkLink
Maximum profit by buying and selling a share at most k timesLinkLink
Find if a string is interleaved of two other stringsLinkLink
Maximum Length of Pair ChainLinkLink

Stacks and Queues:

Implement Stack from ScratchLinkLink
Implement Queue from ScratchLinkLink
Implement 2 stack in an arrayLinkLink
Find the middle element of a stackLinkLink
Implement “N” stacks in an ArrayLinkLink
Check the expression has valid or Balanced parenthesis or not.LinkLink
Reverse a String using StackLinkLink
Design a Stack that supports getMin() in O(1) time and O(1) extra space.LinkLink
Find the next Greater elementLinkLink
The celebrity ProblemLinkLink
Arithmetic Expression evaluationLinkLink
Evaluation of Postfix expressionLinkLink
Implement a method to insert an element at its bottom without using any other data structure.LinkLink
Reverse a stack using recursionLinkLink
Sort a Stack using recursionLinkLink
Merge Overlapping IntervalsLinkLink
Largest rectangular Area in HistogramLinkLink
Length of the Longest Valid SubstringLinkLink
Expression contains redundant bracket or notLinkLink
Implement Stack using QueueLinkLink
Implement Stack using DequeLinkLink
Stack Permutations (Check if an array is stack permutation of other)LinkLink
Implement Queue using StackLinkLink
Implement “n” queue in an arrayLinkLink
Implement a Circular queueLinkLink
LRU Cache ImplementationLinkLink
Reverse a Queue using recursionLinkLink
Reverse the first “K” elements of a queueLinkLink
Interleave the first half of the queue with second halfLinkLink
Find the first circular tour that visits all Petrol PumpsLinkLink
Minimum time required to rot all orangesLinkLink
Distance of nearest cell having 1 in a binary matrixLinkLink
First negative integer in every window of size “k”LinkLink
Check if all levels of two trees are anagrams or not.LinkLink
Sum of minimum and maximum elements of all subarrays of size “k”.LinkLink
Minimum sum of squares of character counts in a given string after removing “k” characters.LinkLink
Queue based approach or first non-repeating character in a stream.LinkLink
Next Smaller ElementLinkLink

Binary Trees:

Level order traversalLinkLink
Reverse Level Order traversalLinkLink
Height of a treeLinkLink
Diameter of a treeLinkLink
Mirror of a treeLinkLink
Inorder Traversal of a tree both using recursion and IterationLinkLink
Preorder Traversal of a tree both using recursion and IterationLinkLink
Postorder Traversal of a tree both using recursion and IterationLinkLink
Left View of a treeLinkLink
Right View of TreeLinkLink
Top View of a treeLinkLink
Bottom View of a treeLinkLink
Zig-Zag traversal of a binary treeLinkLink
Check if a tree is balanced or notLinkLink
Diagonal Traversal of a Binary treeLinkLink
Boundary traversal of a Binary treeLinkLink
Construct Binary Tree from String with Bracket RepresentationLinkLink
Convert Binary tree into Doubly Linked ListLinkLink
Convert Binary tree into Sum treeLinkLink
Construct Binary tree from Inorder and preorder traversalLinkLink
Find minimum swaps required to convert a Binary tree into BSTLinkLink
Check if Binary tree is Sum tree or notLinkLink
Check if all leaf nodes are at same level or notLinkLink
Check if a Binary Tree contains duplicate subtrees of size 2 or more [ IMP ]LinkLink
Check if 2 trees are mirror or notLinkLink
Sum of Nodes on the Longest path from root to leaf nodeLinkLink
Check if given graph is tree or not.  [ IMP ]LinkLink
Find Largest subtree sum in a treeLinkLink
Maximum Sum of nodes in Binary tree such that no two are adjacentLinkLink
Print all “K” Sum paths in a Binary treeLinkLink
Find LCA in a Binary treeLinkLink
Find distance between 2 nodes in a Binary treeLinkLink
Kth Ancestor of node in a Binary treeLinkLink
Find all Duplicate subtrees in a Binary tree [ IMP ]LinkLink
Tree Isomorphism ProblemLinkLink

Binary Search Tree:

Find a value in a BSTLinkLink
Deletion of a node in a BSTLinkLink
Find min and max value in a BSTLinkLink
Find inorder successor and inorder predecessor in a BSTLinkLink
Check if a tree is a BST or notLinkLink
Populate Inorder successor of all nodesLinkLink
Find LCA  of 2 nodes in a BSTLinkLink
Construct BST from preorder traversalLinkLink
Convert Binary tree into BSTLinkLink
Convert a normal BST into a Balanced BSTLinkLink
Merge two BST [ V.V.V>IMP ]LinkLink
Find Kth largest element in a BSTLinkLink
Find Kth smallest element in a BSTLinkLink
Count pairs from 2 BST whose sum is equal to given value “X”LinkLink
Find the median of BST in O(n) time and O(1) spaceLinkLink
Count BST nodes that lie in a given rangeLinkLink
Replace every element with the least greater element on its rightLinkLink
Given “n” appointments, find the conflicting appointmentsLinkLink
Check preorder is valid or notLinkLink
Check whether BST contains Dead endLinkLink
Largest BST in a Binary Tree [ V.V.V.V.V IMP ]LinkLink
Flatten BST to sorted listLinkLink


Create a Graph, print itLinkLink
Implement BFS algorithmLinkLink
Implement DFS AlgoLinkLink
Detect Cycle in Directed Graph using BFS/DFS AlgoLinkLink
Detect Cycle in UnDirected Graph using BFS/DFS AlgoLinkLink
Search in a MazeLinkLink
Minimum Step by KnightLinkLink
Flood fill algoLinkLink
Clone a graphLinkLink
Making wired ConnectionsLinkLink
Word LadderLinkLink
Dijkstra algoLinkLink
Implement Topological SortLinkLink
Minimum time taken by each job to be completed given by a Directed Acyclic GraphLinkLink
Find whether it is possible to finish all tasks or not from given dependenciesLinkLink
Find the no. of IslandsLinkLink
Given a sorted Dictionary of an Alien Language, find order of charactersLinkLink
Implement Kruksal’sAlgorithmLinkLink
Implement Prim’s AlgorithmLinkLink
Total no. of Spanning tree in a graphLinkLink
Implement Bellman Ford AlgorithmLinkLink
Implement Floyd warshall AlgorithmLinkLink
Travelling Salesman ProblemLinkLink
Graph Colouring ProblemLinkLink
Snake and Ladders ProblemLinkLink
Find bridge in a graphLinkLink
Count Strongly connected Components(Kosaraju Algo)LinkLink
Check whether a graph is Bipartite or NotLinkLink
Detect Negative cycle in a graphLinkLink
Longest path in a Directed Acyclic GraphLinkLink
Journey to the MoonLinkLink
Cheapest Flights Within K StopsLinkLink
Oliver and the GameLinkLink
Water Jug problem using BFSLinkLink
Find if there is a path of more thank length from a sourceLinkLink
M-Colouring ProblemLinkLink
Minimum edges to reverse to make path from source to destinationLinkLink
Paths to travel each nodes using each edge(Seven Bridges)LinkLink
Vertex Cover ProblemLinkLink
Chinese Postman or Route InspectionLinkLink
Number of Triangles in a Directed and Undirected GraphLinkLink
Minimise the cashflow among a given set of friends who have borrowed money from each otherLinkLink
Two Clique ProblemLinkLink


Implement a Maxheap/MinHeap using arrays and recursion.LinkLink
Sort an Array using heap. (HeapSort)LinkLink
Maximum of all subarrays of size k.LinkLink
“K” largest element in an arrayLinkLink
Kth smallest and largest element in an unsorted arrayLinkLink
Merge “K” sorted arrays. [ IMP ]LinkLink
Merge 2 Binary Max HeapsLinkLink
Kth largest sum continuous subarraysLinkLink
Leetcode- reorganize stringsLinkLink
Merge “K” Sorted Linked Lists [V.IMP]LinkLink
Smallest range in “K” ListsLinkLink
Median in a stream of IntegersLinkLink
Check if a Binary Tree is HeapLinkLink
Connect “n” ropes with minimum costLinkLink
Convert BST to Min HeapLinkLink
Convert min heap to max heapLinkLink
Rearrange characters in a string such that no two adjacent are same.LinkLink
Minimum sum of two numbers formed from digits of an arrayLinkLink


Construct a trie from scratchLinkLink
Find shortest unique prefix for every word in a given listLinkLink
Word Break Problem | (Trie solution)LinkLink
Given a sequence of words, print all anagrams togetherLinkLink
Implement a Phone DirectoryLinkLink
Print unique rows in a given boolean matrixLinkLink

If you have reached here without any cheating then you have cracked the

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!