/Tinkering_With_Code

My knowledge-management-system a.k.a 2nd Brain for all things DSA, LLD, HLD, Java

Primary LanguageJava

Tinkering_With_Code

a.k.a my learning journal.

Table of Contents

System Design


HLD

Scale from Zero to Million Users

Resume

Point Wise Explanation

LLD

DSA


Significance of constraints

Notes Link

Random Necessary Tidbits
In Java, things are strictly Pass By Value 
(for objects, Pass BY VALUE occurs and it means that REFERENCE is passed as VALUE.)

Pass By Reference :
Scenario --- If teacher has given his original class notes doc to a student, 
any changes he makes there will reflect in others who have the sheet.

Pass By Value :
Scenario --- If teacher has given his printout of Original class notes doc to a student, 
any changes he makes there will reflect in others who have the sheet.


Pass By Reference, happens in C with the help of pointers.

  • Auxiliary space complexity : refers to the extra space or memory required by an algorithm apart from the input size.
  • To reduce the size of number to fit the integer bit range, we use number % MOD where mod = (int) 1e9 + 7;
Integer.MAX_VALUE -> (2^31-1 = 2147483647)
Integer.MIN_VALUE -> (-2^31 = -2147483648)

img.png

  • Combination Formula

img_2.png

n = total number of items

r = items chosen at a time

  • Permutation Formula

img_1.png

n = total number of items

r = items chosen at a time


Recursion

Intro to Recursion

Types :-

Divide and Conquer

Backtracking

Generic Recursion


Arrays

Easy Wins

Famous Problems / One-Ofs

Longest Subarray / Maximum Subarray

Matrix Related

Sorting

Array Rotation

  • Left Rotate an array by one place
  • Left rotate an array by D places

Rearranging Elements

Searching / Finding certain elements or patterns

  • Linear Search
  • Maximum Consecutive Ones
  • Find the number that appears once, and other numbers twice.
  • Find missing number in an array
  • Find-the-repeating-and-missing-numbers
  • Leaders in an array

Sorting


Sliding Window / Two-Pointer Problems

  • two-sum-check-if-a-pair-with-given-sum-exists-in-array
  • union-of-two-sorted-arrays
  • 3-sum-find-triplets-that-add-up-to-a-zero
  • 4sum
  • Container with most water (two pointer / greedy)

Greedy

Fractional Knapsack

Dynamic Programming

0-1 Knapsack
  • [Subset Sum](theory/dsa/Dynamic Programming/SubSetSum.md)
  • [Equal Sum Partition](theory/dsa/Dynamic Programming/EqualSumPartitionProblem.md)
  • [Count of Subset Sum](theory/dsa/Dynamic Programming/CountNumberOfSubsets.md)
  • [Minimum Subset Sum Diff.](theory/dsa/Dynamic Programming/Minimum_Difference_Partition.md)
  • Target Sum
Unbounded Knapsack
Fibonacci
LCS
LIS
Kadene's Algo
Matrix Chain Multiplication
DP on Trees
DP on Grid
Others

Bit Manipulation -- Low Priority

* [base 2 and base 10 conversion of a number]()
* 1s and 2s Compliment
* Must know tricks in Bit Manipulation
* Minimum Bit Flips to convert number
* Power Set
* Single Number 1
* Single Number 2
* Single Number 3
* XOR of numbers of given range
* Divide two integers without using multiplication and division operators

Miscellaneous

Resume
  • [v2](resumes/Ashutosh Roy.pdf)
  • [v1](resumes/Self Resume v1.pdf)
Templates
DSA Sheet For Tracking Progress
Resources to be referred :

https://leetcode.com/discuss/interview-question/5366542/all-leetcode-articles-on-coding-patterns-summarized-in-one-page