/SDE-Sheet

SDE Sheet problem solving on data structures and algorithms

Primary LanguageJavaMIT LicenseMIT

SDE Sheet

SDE Sheet is a list for Mastering Problem Solving with Data Structures and Algorithms in 30 Days

Calendar progress

January 2022

Su Mo Tu We Th Fr Sa
- - - - - - 1 ❌
2 ❌ 3 ❌ 4 ❌ 5 ❌ 6 ❌ 7 ❌ 8 ❌
9 ✅ 10 ✅ 11 ❌ 12 ❌ 13 ❌ 14 ❌ 15 ❌
16 ✅ 17 ❌ 18 ❌ 19 ✅ 20 ❌ 21 ❌ 22 ❌
23 ❌ 24 ❌ 25 ❌ 26 ❌ 27 ❌ 28 ✅ 29 ❌
30 ❌ 31 ❌ - - - - -

February 2022

Su Mo Tu We Th Fr Sa
- - 1 ❌ 2 ❌ 3 ❌ 4 ❌ 5 ❌
6 ❌ 7 ❌ 8 ❌ 9 ❌ 10 ❌ 11 ❌ 12 ❌
13 ✅ 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 - - - - -

🔴 Striver's SDE Sheet

  • Myth: You should be really good at competitive programming
  • Reality:
    • Solving a bunch of 150-200 questions from GFG or Leetcode can get you stronger at Data Structures and Algorithms
    • Solving 150-200 questions gets your problem solving skills up
    • Because you are covering every Algorithm, you are covering Data Structure, you are covering every topic that could be possibly asked in the interview
    • So, once you are done with this 150 - 200 questions, what happens is, you are really good at your problem-solving skills or you are really good at your data structures and algorithms skills
    • And apparently, you are able to crack those interviews
    • This 150 - 200 questions helps you crack the majority of the product based companies in India
  • Striver's SDE Sheet: takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/
  • This 180 questions will take you 1 month (30 days) if you are already into programming.
  • For every day, you need to around 8 to 10 hours, a proper 8 to 10 hours.
  • You should be able to spend 8 to 10 hours because you are wanting to get into India's top most companies and for that you have to sacrifice 8 to 10 hours per day for around 30 to 60 days (1 - 2 months).
  • If you cannot do this, then product based companies do not deserve you, there might be someone else who is waiting for you.
  • So, if you spend 8 - 10 hours per day to solve 6 questions for 30 days without having any cheat days in between, You would have solved 180 questions at the end of the 30 days.
  • After that 30 days, you should be really good at DSA and you should be able to crack any of the product based companies' interviews.
  • You have the list, how will you solve the problems:
    • Let's say, you are solving the problem find the middle of Linked list
    • Search for "middle of Linked list leetcode" on google
    • Open the leetcode problem link, try to solve the problem
    • Now, for best solution go to the Discuss Section and search for Most Votes
    • Sometimes you can go to Solution section of Leetcode
    • If you are not satisfied with those places for solutions, search "middle of Linked list gfg" on google
    • Go to the GFG article and refer the best solutions
  • Source of questions:
    • Striver's interview Experience,
    • Leetcode premium (lists),
    • Striver's work experience at GFG

Note taking Tips from Striver

  • Take a notepad, whenever you are solving a problem and you have successfully solved the problem on Leetcode or GFG, do this:
    • Write a function snippet in your notepad
    • So, what eventually happens is that after 180 questions, all these questions function snippets will be in your notepad
    • Now, make sure that every morning you should revise it (Apply Active Recall study technique)
  • Doing this on the first day may take you 4 hours,
    • the next day it might take you 3 hours,
    • and the next day it will surely take you 2 hours,
    • on the next day it will take you 1 hour and
    • eventually a day will come where it will hardly take 10 - 15 minutes.
    • You will be just crawling thourgh the pages and you will totally get it
    • and everything will stay in your mind
  • Don't memorize it, instead:
    • remember the approaches for the solving the problems,
    • remember the best complextity
  • So, if you remember the approaches, you have your implementation skills, you can easily implement in the interview
  • So, you should keep revising in the notepad on a daily basis
  • Keep doing this till you are interviewing with companies

Interview Prep Requirements

  • Striver's Core Sheet: takeuforward.org/interviews/must-do-questions-for-dbms-cn-os-interviews-sde-core-sheet/
  • Core Subjects: DBMS, Computer Networks, Operating Systems
  • Prepare notes from Striver's Core Sheet Website above
  • Resume:
    • Make sure to write those things in resume which you can answer if the interviewer asks you
  • Projects:
    • You should be ready with a reason for each project you created
    • Which tech stack you have used, and say why you preferred this tech stack and what other tech stacks did you consider
    • What are the difficulties you faced in your projects and what did you do to overcome them
    • So, create a script of 4 - 5 pages on above points for your projects
    • The interviewer will judge on briefing skills, how are you representing the project
  • Problem solving rounds:
    • If you know the given problem, do not jump into the solution directly:
      • because this will make the interviewer change the question
      • and it throws a negative impression that you do not know how to represent yourself in the interview
    • So, intially start off with the Brute-force approach:
      • Say the brute-force approach to the interviewer
      • Run some test cases on your brute-force approach
      • Say the time complexity and space complexity
      • Two things may happen:
        • The interviewer may ask you to code the brute-force
        • Or might ask you to make the brute-force approach better
    • Now, spend 5 to 10 minutes to present your thought process to getting towards the optimal appraoch
      • Write some test cases
      • Do some dry run
    • Now, you give the efficient approach to the interviewer. Once he is satisfied, provide the time complexity and space complexity
    • Now, the interviewer will ask you to code it:
      • Do not blindly write the code, that's a common mistake
      • Ask the interviewer that "Should I only write the function?" or "Should I write the entire code?"
      • Most of the cases, the interviewer will say "Yes" to write function snippet
      • Now, you write the code snippet in such a way that you are in the ears of the interviewer every time:
        • When you write the function, you tell him this function will do this and this
        • If you take two parameters, tell him that the 1st parameter is this and 2nd parameter is this, intially I will pass this and this
        • Tell him you are intiializing this and this
        • Do this until he/she says "please write the code and then once you are done then you can explain"
    • This process of interviewing send them the message that you actually want the job and you are really prepared and you are really motivated to bag it

Note taking - Ground rules

  • Topicwise, note down what type of problem uses which pattern to be solved via which type of optimization
Topicwise: Problem - Pattern - Optimization
  • Problem Solving Goal on Day-to-Day basis:
3 hours / day         =  6 Questions per day
6 Q's / day     * 30  =  180 Questions per month
180 Q's / month * 4   =  720 Questions in 4 months
  • Problem Solving is more important than note making, so don't stress too much in notes/documentation

Why SDE Sheet?

  • Solving 150 - 200 DS ALGO Questions on leetcode gets your problem solving skills up 💹

SDE Sheet Problems

✅/❌ No. Problem Pattern(s) Opimization
Arrays
1 Sort an array of 0’s 1’s 2’s without using extra space or sorting algo
2 Repeat and Missing Number
3 Merge two sorted Arrays without extra space
4 Kadanes Algorithm
5 Merge Overlapping Subintervals
6 Find the duplicate in an array of N+1 integers
7 Set Matrix Zeroes
8 Pascal's Triangle
9 Next Permutation
10 Count Inversions in an array
11 Best Time to Buy and Sell Stock
12 Rotate Image
13 Search a 2D Matrix
14 Pow(x, n)
15 Majority Element
16 Majority Element II
17 Unique Paths
18 Reverse Pairs
Hashmaps
19 Two Sum
20 4Sum
21 Longest Consecutive Sequence
22 Largest subarray with 0 sum
23 Count the number of subarrays having a given XOR
24 Longest Substring Without Repeating Characters
Linked lists
2 pointers
Greedy algorithms
Recursion
Backtracking
Binary Search
Bit Manipulation
Stacks and Queues
Miscellaneous
Strings
Binary Trees
Binary Search Trees
Mixed Questions
Graphs
Dynamic Programming