Sde Problems
Sde Problems
Sde Problems
To know the entire list and other stuffs like Projects, Resume, how to give interviews….watch
the entire video at:
https://www.youtube.com/watch?v=WNtzUR_MwUQ
Only start doing these problems if you feel you are comfortable with solving basic problems
of DSA. Once you are, you can start preparing for these problems, because these problems
are solely interview based.
Day1: (Arrays)
1. Sort an array of 0’s 1’s 2’s without using extra space or sorting algo
https://www.youtube.com/watch?v=oaVa-9wmpns&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=2 (Problem link in description)
4. Kadane’s Algorithm
https://www.youtube.com/watch?v=w_KEocd__20&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=5
Day2: (Arrays)
1. Set Matrix Zeros
(https://www.youtube.com/watch?v=M65xBewcqcI&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=7)
2. Pascal Triangle
https://www.youtube.com/watch?v=6FLvhQjZqvM&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=8
3. Next Permutation
https://www.youtube.com/watch?v=LuLCLgMElus&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=9
6. Rotate Matrix
https://www.youtube.com/watch?v=Y72QeX0Efxw&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=12
Day3: (Arrays/maths)
1. Search in a 2D matrix
https://www.youtube.com/watch?v=ZYpYur0znng&list=PLgUwDviBIf0rPG3Ictpu74YW
BQ1CaBkm2&index=13
2. Pow(X,n)
https://www.youtube.com/watch?v=l0YC3876qxg&list=PLgUwDviBIf0rPG3Ictpu74Y
WBQ1CaBkm2&index=14
Day4: (Hashing)
1. 2 Sum problem
https://www.youtube.com/watch?v=dRUpbt8vHpo&list=PLgUwDviBIf0rVwua0kKYlsS
_ik_1lyVK_&index=1
2. 4 Sum problem
https://www.youtube.com/watch?v=4ggF3tXIAp0&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=20
Day5: (LinkedList)
1. Reverse a LinkedList
https://www.youtube.com/watch?v=iRtLEoL-r-g&list=PLgUwDviBIf0p4ozDR_kJJkON
nb1wdx2Ma&index=26
Day6:
1. Find intersection point of Y LinkedList
https://www.youtube.com/watch?v=u4FWXfgS8jw&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=32
6. Flattening of a LinkedList
https://www.youtube.com/watch?v=ysytSSXpAI0&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=37
7. Rotate a LinkedList
https://www.youtube.com/watch?v=9VPm6nEbVPA&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=38
Day7: (2-pointer)
1. Clone a Linked List with random and next pointer
https://www.youtube.com/watch?v=VNf6VynfpdM&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=39
2. 3 sum
https://www.youtube.com/watch?v=onLoX6Nhvmg&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=40
3. Trapping rainwater
https://www.youtube.com/watch?v=m18Hntz4go8&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=41
Day8: (Greedy)
1. N meeting in one room
https://www.youtube.com/watch?v=II6ziNnub1Q&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=44
1. Subset Sums
https://www.youtube.com/watch?v=rYkfBRtMJr8&list=PLgUwDviBIf0p4ozDR_kJJkO
Nnb1wdx2Ma&index=52
2. Subset-II
https://www.youtube.com/watch?v=RIn3gOkbhQE&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=53
3. Combination sum-1
https://www.youtube.com/watch?v=OyZFFqQtu98&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=49
4. Combination sum-2
https://www.youtube.com/watch?v=G1fRTGRxXU8&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=50
5. Palindrome Partitioning
https://www.youtube.com/watch?v=WBgsABoClE0&list=PLgUwDviBIf0p4ozDR_kJJk
ONnb1wdx2Ma&index=51
2. N queens Problem
3. Sudoku
4. M coloring Problem (Graph prob)
5. Rat in a Maze
6. Word Break (print all ways)
Day14:
1. Next Smaller Element
2. LRU cache (vvvv. imp)
3. Largest rectangle in histogram
4. Sliding Window maximum
5. Implement Min Stack
6. Rotten Orange (Using BFS)
Day15: (String)
1. Reverse Words in a String
2. Longest Palindrome in a string
3. Roman Number to Integer and vice versa
4. Implement ATOI/STRSTR
5. Longest Common Prefix
6. Rabin Karp
Day16: (String)
1. Prefix Function/Z-Function
2. KMP algo
3. Minimum characters needed to be inserted in the beginning to make it palindromic.
4. Check for Anagrams
5. Count and Say
6. Compare version numbers
Day21: (BinarySearchTree)
1. Floor and Ceil in a BST
2. Find K-th smallest and K-th largest element in BST (2 different Questions)
3. Find a pair with a given sum in BST
4. BST iterator
5. Size of the largest BST in a Binary Tree
6. Serialize and deserialize Binary Tree
Day23: (Graph)
1. Clone a graph (Not that easy as it looks)
2. DFS
3. BFS
4. Detect A cycle in Undirected Graph/Directed Graph
5. Topo Sort
6. Number of islands (Do in Grid and Graph both)
7. Bipartite Check
Day24: (Graph)
1. SCC(using KosaRaju’s algo)
2. Djisktra’s Algorithm
3. Bellman Ford Algo
4. Floyd Warshall Algorithm
5. MST using Prim’s Algo
6. MST using Kruskal’s Algo
Day26: (DP)
1. Maximum sum path in matrix, (count paths, and similar type do, also backtrack to find
the maximum path)
2. Coin change
3. Subset Sum
4. Rod Cutting
5. Egg Dropping
6. Word Break
7. Palindrome Partitioning (MCM Variation)
8. Maximum profit in Job scheduling
Day27:
1. Revise OS notes that you would have made during your sem
2. If not made notes, spend 2 or 3 days and make notes from Knowledge Gate.
Day28:
1. Revise DBMS notes that you would have made during your semesters.
2. If not made notes, spend 2 or 3 days and make notes from Knowledge Gate.
Day29:
1. Revise CN notes, that you would have made during your sem.
2. If not made notes, spend 2 or 3 days and make notes from Knowledge Gate.
Day30:
1. Make a note of how will your represent your projects, and prepare all questions
related to tech which you have used in your projects. Prepare a note which you can
say for 3-10 minutes when he asks you that say something about the project.
Hurrah!! You are ready for your placement after a month of hard-work without a cheat day.